use ::libc;
extern "C" {
    pub type _IO_wide_data;
    pub type _IO_codecvt;
    pub type _IO_marker;
    pub type event_base;
    pub type evbuffer;
    pub type bufferevent_ops;
    pub type args;
    pub type tmuxpeer;
    pub type hyperlinks;
    pub type screen_write_cline;
    pub type screen_sel;
    pub type screen_titles;
    pub type environ;
    pub type options;
    pub type format_tree;
    pub type input_ctx;
    pub type cmds;
    pub type tty_key;
    pub type tty_code;
    pub type format_job_tree;
    pub type control_state;
    pub type cmdq_list;
    pub type cmdq_item;
    pub type job;
    pub type menu_data;
    pub type screen_write_citem;
    pub type paste_buffer;
    fn unlink(__name: *const libc::c_char) -> libc::c_int;
    fn malloc(_: libc::c_ulong) -> *mut libc::c_void;
    fn free(_: *mut libc::c_void);
    fn mkstemp(__template: *mut libc::c_char) -> libc::c_int;
    fn memcpy(_: *mut libc::c_void, _: *const libc::c_void, _: libc::c_ulong) -> *mut libc::c_void;
    fn fclose(__stream: *mut FILE) -> libc::c_int;
    fn fopen(_: *const libc::c_char, _: *const libc::c_char) -> *mut FILE;
    fn fdopen(__fd: libc::c_int, __modes: *const libc::c_char) -> *mut FILE;
    fn fread(
        _: *mut libc::c_void,
        _: libc::c_ulong,
        _: libc::c_ulong,
        _: *mut FILE,
    ) -> libc::c_ulong;
    fn fwrite(
        _: *const libc::c_void,
        _: libc::c_ulong,
        _: libc::c_ulong,
        _: *mut FILE,
    ) -> libc::c_ulong;
    fn fseeko(__stream: *mut FILE, __off: __off_t, __whence: libc::c_int) -> libc::c_int;
    fn ftello(__stream: *mut FILE) -> __off_t;
    fn evbuffer_get_length(buf: *const evbuffer) -> size_t;
    fn evbuffer_drain(buf: *mut evbuffer, len: size_t) -> libc::c_int;
    fn evbuffer_pullup(buf: *mut evbuffer, size: ssize_t) -> *mut libc::c_uchar;
    fn bufferevent_write(
        bufev: *mut bufferevent,
        data: *const libc::c_void,
        size: size_t,
    ) -> libc::c_int;
    fn xcalloc(_: size_t, _: size_t) -> *mut libc::c_void;
    fn xstrdup(_: *const libc::c_char) -> *mut libc::c_char;
    fn xasprintf(_: *mut *mut libc::c_char, _: *const libc::c_char, _: ...) -> libc::c_int;
    fn input_parse_screen(
        _: *mut input_ctx,
        _: *mut screen,
        _: screen_write_init_ctx_cb,
        _: *mut libc::c_void,
        _: *mut u_char,
        _: size_t,
    );
    static mut global_options: *mut options;
    static mut global_w_options: *mut options;
    fn checkshell(_: *const libc::c_char) -> libc::c_int;
    fn paste_buffer_data(_: *mut paste_buffer, _: *mut size_t) -> *const libc::c_char;
    fn paste_get_top(_: *mut *const libc::c_char) -> *mut paste_buffer;
    fn options_get_string(_: *mut options, _: *const libc::c_char) -> *const libc::c_char;
    fn options_get_number(_: *mut options, _: *const libc::c_char) -> libc::c_longlong;
    fn job_run(
        _: *const libc::c_char,
        _: libc::c_int,
        _: *mut *mut libc::c_char,
        _: *mut environ,
        _: *mut session,
        _: *const libc::c_char,
        _: job_update_cb,
        _: job_complete_cb,
        _: job_free_cb,
        _: *mut libc::c_void,
        _: libc::c_int,
        _: libc::c_int,
        _: libc::c_int,
    ) -> *mut job;
    fn job_free(_: *mut job);
    fn job_transfer(_: *mut job, _: *mut pid_t, _: *mut libc::c_char, _: size_t) -> libc::c_int;
    fn job_resize(_: *mut job, _: u_int, _: u_int);
    fn job_get_status(_: *mut job) -> libc::c_int;
    fn job_get_data(_: *mut job) -> *mut libc::c_void;
    fn job_get_event(_: *mut job) -> *mut bufferevent;
    fn tty_draw_line(
        _: *mut tty,
        _: *mut screen,
        _: u_int,
        _: u_int,
        _: u_int,
        _: u_int,
        _: u_int,
        _: *const grid_cell,
        _: *mut colour_palette,
    );
    fn cmdq_get_client(_: *mut cmdq_item) -> *mut client;
    fn cmdq_continue(_: *mut cmdq_item);
    fn server_client_set_overlay(
        _: *mut client,
        _: u_int,
        _: overlay_check_cb,
        _: overlay_mode_cb,
        _: overlay_draw_cb,
        _: overlay_key_cb,
        _: overlay_free_cb,
        _: overlay_resize_cb,
        _: *mut libc::c_void,
    );
    fn server_client_clear_overlay(_: *mut client);
    fn server_client_overlay_range(
        _: u_int,
        _: u_int,
        _: u_int,
        _: u_int,
        _: u_int,
        _: u_int,
        _: u_int,
        _: *mut overlay_ranges,
    );
    fn server_client_unref(_: *mut client);
    fn server_redraw_client(_: *mut client);
    fn input_init(
        _: *mut window_pane,
        _: *mut bufferevent,
        _: *mut colour_palette,
    ) -> *mut input_ctx;
    fn input_free(_: *mut input_ctx);
    fn screen_write_start(_: *mut screen_write_ctx, _: *mut screen);
    fn screen_write_stop(_: *mut screen_write_ctx);
    fn screen_write_fast_copy(
        _: *mut screen_write_ctx,
        _: *mut screen,
        _: u_int,
        _: u_int,
        _: u_int,
        _: u_int,
    );
    fn screen_write_box(
        _: *mut screen_write_ctx,
        _: u_int,
        _: u_int,
        _: box_lines,
        _: *const grid_cell,
        _: *const libc::c_char,
    );
    fn screen_write_cursormove(
        _: *mut screen_write_ctx,
        _: libc::c_int,
        _: libc::c_int,
        _: libc::c_int,
    );
    fn screen_write_clearscreen(_: *mut screen_write_ctx, _: u_int);
    fn screen_init(_: *mut screen, _: u_int, _: u_int, _: u_int);
    fn screen_free(_: *mut screen);
    fn screen_set_title(_: *mut screen, _: *const libc::c_char) -> libc::c_int;
    fn screen_resize(_: *mut screen, _: u_int, _: u_int, _: libc::c_int);
    fn window_pane_set_event(_: *mut window_pane);
    fn window_set_active_pane(_: *mut window, _: *mut window_pane, _: libc::c_int) -> libc::c_int;
    fn window_add_pane(
        _: *mut window,
        _: *mut window_pane,
        _: u_int,
        _: libc::c_int,
    ) -> *mut window_pane;
    fn window_unzoom(_: *mut window, _: libc::c_int) -> libc::c_int;
    fn layout_assign_pane(_: *mut layout_cell, _: *mut window_pane, _: libc::c_int);
    fn layout_split_pane(
        _: *mut window_pane,
        _: layout_type,
        _: libc::c_int,
        _: libc::c_int,
    ) -> *mut layout_cell;
    fn input_key(_: *mut screen, _: *mut bufferevent, _: key_code) -> libc::c_int;
    fn input_key_get_mouse(
        _: *mut screen,
        _: *mut mouse_event,
        _: u_int,
        _: u_int,
        _: *mut *const libc::c_char,
        _: *mut size_t,
    ) -> libc::c_int;
    fn colour_palette_init(_: *mut colour_palette);
    fn colour_palette_free(_: *mut colour_palette);
    fn colour_palette_from_option(_: *mut colour_palette, _: *mut options);
    static grid_default_cell: grid_cell;
    fn menu_check_cb(
        _: *mut client,
        _: *mut libc::c_void,
        _: u_int,
        _: u_int,
        _: u_int,
        _: *mut overlay_ranges,
    );
    fn menu_create(_: *const libc::c_char) -> *mut menu;
    fn menu_add_items(
        _: *mut menu,
        _: *const menu_item,
        _: *mut cmdq_item,
        _: *mut client,
        _: *mut cmd_find_state,
    );
    fn menu_prepare(
        _: *mut menu,
        _: libc::c_int,
        _: libc::c_int,
        _: *mut cmdq_item,
        _: u_int,
        _: u_int,
        _: *mut client,
        _: box_lines,
        _: *const libc::c_char,
        _: *const libc::c_char,
        _: *const libc::c_char,
        _: *mut cmd_find_state,
        _: menu_choice_cb,
        _: *mut libc::c_void,
    ) -> *mut menu_data;
    fn menu_mode_cb(
        _: *mut client,
        _: *mut libc::c_void,
        _: *mut u_int,
        _: *mut u_int,
    ) -> *mut screen;
    fn style_set(_: *mut style, _: *const grid_cell);
    fn menu_draw_cb(_: *mut client, _: *mut libc::c_void, _: *mut screen_redraw_ctx);
    fn menu_free_cb(_: *mut client, _: *mut libc::c_void);
    fn menu_key_cb(_: *mut client, _: *mut libc::c_void, _: *mut key_event) -> libc::c_int;
    fn style_apply(_: *mut grid_cell, _: *mut options, _: *const libc::c_char, _: *mut format_tree);
    fn style_parse(_: *mut style, _: *const grid_cell, _: *const libc::c_char) -> libc::c_int;
}
pub type __u_char = libc::c_uchar;
pub type __u_short = libc::c_ushort;
pub type __u_int = libc::c_uint;
pub type __uint8_t = libc::c_uchar;
pub type __uint64_t = libc::c_ulong;
pub type __uintmax_t = libc::c_ulong;
pub type __off_t = libc::c_long;
pub type __off64_t = libc::c_long;
pub type __pid_t = libc::c_int;
pub type __time_t = libc::c_long;
pub type __suseconds_t = libc::c_long;
pub type __ssize_t = libc::c_long;
pub type u_char = __u_char;
pub type u_short = __u_short;
pub type u_int = __u_int;
pub type off_t = __off_t;
pub type pid_t = __pid_t;
pub type ssize_t = __ssize_t;
pub type time_t = __time_t;
pub type size_t = libc::c_ulong;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct timeval {
    pub tv_sec: __time_t,
    pub tv_usec: __suseconds_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct _IO_FILE {
    pub _flags: libc::c_int,
    pub _IO_read_ptr: *mut libc::c_char,
    pub _IO_read_end: *mut libc::c_char,
    pub _IO_read_base: *mut libc::c_char,
    pub _IO_write_base: *mut libc::c_char,
    pub _IO_write_ptr: *mut libc::c_char,
    pub _IO_write_end: *mut libc::c_char,
    pub _IO_buf_base: *mut libc::c_char,
    pub _IO_buf_end: *mut libc::c_char,
    pub _IO_save_base: *mut libc::c_char,
    pub _IO_backup_base: *mut libc::c_char,
    pub _IO_save_end: *mut libc::c_char,
    pub _markers: *mut _IO_marker,
    pub _chain: *mut _IO_FILE,
    pub _fileno: libc::c_int,
    pub _flags2: libc::c_int,
    pub _old_offset: __off_t,
    pub _cur_column: libc::c_ushort,
    pub _vtable_offset: libc::c_schar,
    pub _shortbuf: [libc::c_char; 1],
    pub _lock: *mut libc::c_void,
    pub _offset: __off64_t,
    pub _codecvt: *mut _IO_codecvt,
    pub _wide_data: *mut _IO_wide_data,
    pub _freeres_list: *mut _IO_FILE,
    pub _freeres_buf: *mut libc::c_void,
    pub __pad5: size_t,
    pub _mode: libc::c_int,
    pub _unused2: [libc::c_char; 20],
}
pub type _IO_lock_t = ();
pub type FILE = _IO_FILE;
pub type cc_t = libc::c_uchar;
pub type speed_t = libc::c_uint;
pub type tcflag_t = libc::c_uint;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct termios {
    pub c_iflag: tcflag_t,
    pub c_oflag: tcflag_t,
    pub c_cflag: tcflag_t,
    pub c_lflag: tcflag_t,
    pub c_line: cc_t,
    pub c_cc: [cc_t; 32],
    pub c_ispeed: speed_t,
    pub c_ospeed: speed_t,
}
pub type uint8_t = __uint8_t;
pub type uint64_t = __uint64_t;
pub type uintmax_t = __uintmax_t;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct event {
    pub ev_evcallback: event_callback,
    pub ev_timeout_pos: C2RustUnnamed_4,
    pub ev_fd: libc::c_int,
    pub ev_base: *mut event_base,
    pub ev_: C2RustUnnamed,
    pub ev_events: libc::c_short,
    pub ev_res: libc::c_short,
    pub ev_timeout: timeval,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed {
    pub ev_io: C2RustUnnamed_2,
    pub ev_signal: C2RustUnnamed_0,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_0 {
    pub ev_signal_next: C2RustUnnamed_1,
    pub ev_ncalls: libc::c_short,
    pub ev_pncalls: *mut libc::c_short,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_1 {
    pub le_next: *mut event,
    pub le_prev: *mut *mut event,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_2 {
    pub ev_io_next: C2RustUnnamed_3,
    pub ev_timeout: timeval,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_3 {
    pub le_next: *mut event,
    pub le_prev: *mut *mut event,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed_4 {
    pub ev_next_with_common_timeout: C2RustUnnamed_5,
    pub min_heap_idx: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_5 {
    pub tqe_next: *mut event,
    pub tqe_prev: *mut *mut event,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct event_callback {
    pub evcb_active_next: C2RustUnnamed_7,
    pub evcb_flags: libc::c_short,
    pub evcb_pri: uint8_t,
    pub evcb_closure: uint8_t,
    pub evcb_cb_union: C2RustUnnamed_6,
    pub evcb_arg: *mut libc::c_void,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed_6 {
    pub evcb_callback:
        Option<unsafe extern "C" fn(libc::c_int, libc::c_short, *mut libc::c_void) -> ()>,
    pub evcb_selfcb: Option<unsafe extern "C" fn(*mut event_callback, *mut libc::c_void) -> ()>,
    pub evcb_evfinalize: Option<unsafe extern "C" fn(*mut event, *mut libc::c_void) -> ()>,
    pub evcb_cbfinalize: Option<unsafe extern "C" fn(*mut event_callback, *mut libc::c_void) -> ()>,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_7 {
    pub tqe_next: *mut event_callback,
    pub tqe_prev: *mut *mut event_callback,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct bufferevent {
    pub ev_base: *mut event_base,
    pub be_ops: *const bufferevent_ops,
    pub ev_read: event,
    pub ev_write: event,
    pub input: *mut evbuffer,
    pub output: *mut evbuffer,
    pub wm_read: event_watermark,
    pub wm_write: event_watermark,
    pub readcb: bufferevent_data_cb,
    pub writecb: bufferevent_data_cb,
    pub errorcb: bufferevent_event_cb,
    pub cbarg: *mut libc::c_void,
    pub timeout_read: timeval,
    pub timeout_write: timeval,
    pub enabled: libc::c_short,
}
pub type bufferevent_event_cb =
    Option<unsafe extern "C" fn(*mut bufferevent, libc::c_short, *mut libc::c_void) -> ()>;
pub type bufferevent_data_cb =
    Option<unsafe extern "C" fn(*mut bufferevent, *mut libc::c_void) -> ()>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct event_watermark {
    pub low: size_t,
    pub high: size_t,
}
pub type bitstr_t = libc::c_uchar;
pub type msgtype = libc::c_uint;
pub const MSG_READ_CANCEL: msgtype = 307;
pub const MSG_WRITE_CLOSE: msgtype = 306;
pub const MSG_WRITE_READY: msgtype = 305;
pub const MSG_WRITE: msgtype = 304;
pub const MSG_WRITE_OPEN: msgtype = 303;
pub const MSG_READ_DONE: msgtype = 302;
pub const MSG_READ: msgtype = 301;
pub const MSG_READ_OPEN: msgtype = 300;
pub const MSG_FLAGS: msgtype = 218;
pub const MSG_EXEC: msgtype = 217;
pub const MSG_WAKEUP: msgtype = 216;
pub const MSG_UNLOCK: msgtype = 215;
pub const MSG_SUSPEND: msgtype = 214;
pub const MSG_OLDSTDOUT: msgtype = 213;
pub const MSG_OLDSTDIN: msgtype = 212;
pub const MSG_OLDSTDERR: msgtype = 211;
pub const MSG_SHUTDOWN: msgtype = 210;
pub const MSG_SHELL: msgtype = 209;
pub const MSG_RESIZE: msgtype = 208;
pub const MSG_READY: msgtype = 207;
pub const MSG_LOCK: msgtype = 206;
pub const MSG_EXITING: msgtype = 205;
pub const MSG_EXITED: msgtype = 204;
pub const MSG_EXIT: msgtype = 203;
pub const MSG_DETACHKILL: msgtype = 202;
pub const MSG_DETACH: msgtype = 201;
pub const MSG_COMMAND: msgtype = 200;
pub const MSG_IDENTIFY_TERMINFO: msgtype = 112;
pub const MSG_IDENTIFY_LONGFLAGS: msgtype = 111;
pub const MSG_IDENTIFY_STDOUT: msgtype = 110;
pub const MSG_IDENTIFY_FEATURES: msgtype = 109;
pub const MSG_IDENTIFY_CWD: msgtype = 108;
pub const MSG_IDENTIFY_CLIENTPID: msgtype = 107;
pub const MSG_IDENTIFY_DONE: msgtype = 106;
pub const MSG_IDENTIFY_ENVIRON: msgtype = 105;
pub const MSG_IDENTIFY_STDIN: msgtype = 104;
pub const MSG_IDENTIFY_OLDCWD: msgtype = 103;
pub const MSG_IDENTIFY_TTYNAME: msgtype = 102;
pub const MSG_IDENTIFY_TERM: msgtype = 101;
pub const MSG_IDENTIFY_FLAGS: msgtype = 100;
pub const MSG_VERSION: msgtype = 12;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client {
    pub name: *const libc::c_char,
    pub peer: *mut tmuxpeer,
    pub queue: *mut cmdq_list,
    pub windows: client_windows,
    pub control_state: *mut control_state,
    pub pause_age: u_int,
    pub pid: pid_t,
    pub fd: libc::c_int,
    pub out_fd: libc::c_int,
    pub event: event,
    pub retval: libc::c_int,
    pub creation_time: timeval,
    pub activity_time: timeval,
    pub last_activity_time: timeval,
    pub environ: *mut environ,
    pub jobs: *mut format_job_tree,
    pub title: *mut libc::c_char,
    pub path: *mut libc::c_char,
    pub cwd: *const libc::c_char,
    pub term_name: *mut libc::c_char,
    pub term_features: libc::c_int,
    pub term_type: *mut libc::c_char,
    pub term_caps: *mut *mut libc::c_char,
    pub term_ncaps: u_int,
    pub ttyname: *mut libc::c_char,
    pub tty: tty,
    pub written: size_t,
    pub discarded: size_t,
    pub redraw: size_t,
    pub repeat_timer: event,
    pub click_timer: event,
    pub click_button: u_int,
    pub click_event: mouse_event,
    pub status: status_line,
    pub flags: uint64_t,
    pub exit_type: C2RustUnnamed_30,
    pub exit_msgtype: msgtype,
    pub exit_session: *mut libc::c_char,
    pub exit_message: *mut libc::c_char,
    pub keytable: *mut key_table,
    pub last_key: key_code,
    pub redraw_panes: uint64_t,
    pub redraw_scrollbars: uint64_t,
    pub message_ignore_keys: libc::c_int,
    pub message_ignore_styles: libc::c_int,
    pub message_string: *mut libc::c_char,
    pub message_timer: event,
    pub prompt_string: *mut libc::c_char,
    pub prompt_buffer: *mut utf8_data,
    pub prompt_last: *mut libc::c_char,
    pub prompt_index: size_t,
    pub prompt_inputcb: prompt_input_cb,
    pub prompt_freecb: prompt_free_cb,
    pub prompt_data: *mut libc::c_void,
    pub prompt_hindex: [u_int; 4],
    pub prompt_mode: C2RustUnnamed_27,
    pub prompt_saved: *mut utf8_data,
    pub prompt_flags: libc::c_int,
    pub prompt_type: prompt_type,
    pub prompt_cursor: libc::c_int,
    pub session: *mut session,
    pub last_session: *mut session,
    pub references: libc::c_int,
    pub pan_window: *mut libc::c_void,
    pub pan_ox: u_int,
    pub pan_oy: u_int,
    pub overlay_check: overlay_check_cb,
    pub overlay_mode: overlay_mode_cb,
    pub overlay_draw: overlay_draw_cb,
    pub overlay_key: overlay_key_cb,
    pub overlay_free: overlay_free_cb,
    pub overlay_resize: overlay_resize_cb,
    pub overlay_data: *mut libc::c_void,
    pub overlay_timer: event,
    pub files: client_files,
    pub clipboard_panes: *mut u_int,
    pub clipboard_npanes: u_int,
    pub entry: C2RustUnnamed_8,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_8 {
    pub tqe_next: *mut client,
    pub tqe_prev: *mut *mut client,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client_files {
    pub rbh_root: *mut client_file,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client_file {
    pub c: *mut client,
    pub peer: *mut tmuxpeer,
    pub tree: *mut client_files,
    pub references: libc::c_int,
    pub stream: libc::c_int,
    pub path: *mut libc::c_char,
    pub buffer: *mut evbuffer,
    pub event: *mut bufferevent,
    pub fd: libc::c_int,
    pub error: libc::c_int,
    pub closed: libc::c_int,
    pub cb: client_file_cb,
    pub data: *mut libc::c_void,
    pub entry: C2RustUnnamed_9,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_9 {
    pub rbe_left: *mut client_file,
    pub rbe_right: *mut client_file,
    pub rbe_parent: *mut client_file,
    pub rbe_color: libc::c_int,
}
pub type client_file_cb = Option<
    unsafe extern "C" fn(
        *mut client,
        *const libc::c_char,
        libc::c_int,
        libc::c_int,
        *mut evbuffer,
        *mut libc::c_void,
    ) -> (),
>;
pub type overlay_resize_cb = Option<unsafe extern "C" fn(*mut client, *mut libc::c_void) -> ()>;
pub type overlay_free_cb = Option<unsafe extern "C" fn(*mut client, *mut libc::c_void) -> ()>;
pub type overlay_key_cb =
    Option<unsafe extern "C" fn(*mut client, *mut libc::c_void, *mut key_event) -> libc::c_int>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct key_event {
    pub key: key_code,
    pub m: mouse_event,
    pub buf: *mut libc::c_char,
    pub len: size_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct mouse_event {
    pub valid: libc::c_int,
    pub ignore: libc::c_int,
    pub key: key_code,
    pub statusat: libc::c_int,
    pub statuslines: u_int,
    pub x: u_int,
    pub y: u_int,
    pub b: u_int,
    pub lx: u_int,
    pub ly: u_int,
    pub lb: u_int,
    pub ox: u_int,
    pub oy: u_int,
    pub s: libc::c_int,
    pub w: libc::c_int,
    pub wp: libc::c_int,
    pub sgr_type: u_int,
    pub sgr_b: u_int,
}
pub type key_code = libc::c_ulonglong;
pub type overlay_draw_cb =
    Option<unsafe extern "C" fn(*mut client, *mut libc::c_void, *mut screen_redraw_ctx) -> ()>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct screen_redraw_ctx {
    pub c: *mut client,
    pub statuslines: u_int,
    pub statustop: libc::c_int,
    pub pane_status: libc::c_int,
    pub pane_lines: pane_lines,
    pub pane_scrollbars: libc::c_int,
    pub pane_scrollbars_pos: libc::c_int,
    pub no_pane_gc: grid_cell,
    pub no_pane_gc_set: libc::c_int,
    pub sx: u_int,
    pub sy: u_int,
    pub ox: u_int,
    pub oy: u_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct grid_cell {
    pub data: utf8_data,
    pub attr: u_short,
    pub flags: u_char,
    pub fg: libc::c_int,
    pub bg: libc::c_int,
    pub us: libc::c_int,
    pub link: u_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct utf8_data {
    pub data: [u_char; 21],
    pub have: u_char,
    pub size: u_char,
    pub width: u_char,
}
pub type pane_lines = libc::c_uint;
pub const PANE_LINES_NUMBER: pane_lines = 4;
pub const PANE_LINES_SIMPLE: pane_lines = 3;
pub const PANE_LINES_HEAVY: pane_lines = 2;
pub const PANE_LINES_DOUBLE: pane_lines = 1;
pub const PANE_LINES_SINGLE: pane_lines = 0;
pub type overlay_mode_cb = Option<
    unsafe extern "C" fn(*mut client, *mut libc::c_void, *mut u_int, *mut u_int) -> *mut screen,
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct screen {
    pub title: *mut libc::c_char,
    pub path: *mut libc::c_char,
    pub titles: *mut screen_titles,
    pub grid: *mut grid,
    pub cx: u_int,
    pub cy: u_int,
    pub cstyle: screen_cursor_style,
    pub default_cstyle: screen_cursor_style,
    pub ccolour: libc::c_int,
    pub default_ccolour: libc::c_int,
    pub rupper: u_int,
    pub rlower: u_int,
    pub mode: libc::c_int,
    pub default_mode: libc::c_int,
    pub saved_cx: u_int,
    pub saved_cy: u_int,
    pub saved_grid: *mut grid,
    pub saved_cell: grid_cell,
    pub saved_flags: libc::c_int,
    pub tabs: *mut bitstr_t,
    pub sel: *mut screen_sel,
    pub write_list: *mut screen_write_cline,
    pub hyperlinks: *mut hyperlinks,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct grid {
    pub flags: libc::c_int,
    pub sx: u_int,
    pub sy: u_int,
    pub hscrolled: u_int,
    pub hsize: u_int,
    pub hlimit: u_int,
    pub linedata: *mut grid_line,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct grid_line {
    pub celldata: *mut grid_cell_entry,
    pub cellused: u_int,
    pub cellsize: u_int,
    pub extddata: *mut grid_extd_entry,
    pub extdsize: u_int,
    pub flags: libc::c_int,
    pub time: time_t,
}
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct grid_extd_entry {
    pub data: utf8_char,
    pub attr: u_short,
    pub flags: u_char,
    pub fg: libc::c_int,
    pub bg: libc::c_int,
    pub us: libc::c_int,
    pub link: u_int,
}
pub type utf8_char = u_int;
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct grid_cell_entry {
    pub c2rust_unnamed: C2RustUnnamed_10,
    pub flags: u_char,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union C2RustUnnamed_10 {
    pub offset: u_int,
    pub data: C2RustUnnamed_11,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_11 {
    pub attr: u_char,
    pub fg: u_char,
    pub bg: u_char,
    pub data: u_char,
}
pub type screen_cursor_style = libc::c_uint;
pub const SCREEN_CURSOR_BAR: screen_cursor_style = 3;
pub const SCREEN_CURSOR_UNDERLINE: screen_cursor_style = 2;
pub const SCREEN_CURSOR_BLOCK: screen_cursor_style = 1;
pub const SCREEN_CURSOR_DEFAULT: screen_cursor_style = 0;
pub type overlay_check_cb = Option<
    unsafe extern "C" fn(
        *mut client,
        *mut libc::c_void,
        u_int,
        u_int,
        u_int,
        *mut overlay_ranges,
    ) -> (),
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct overlay_ranges {
    pub px: [u_int; 3],
    pub nx: [u_int; 3],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct session {
    pub id: u_int,
    pub name: *mut libc::c_char,
    pub cwd: *const libc::c_char,
    pub creation_time: timeval,
    pub last_attached_time: timeval,
    pub activity_time: timeval,
    pub last_activity_time: timeval,
    pub lock_timer: event,
    pub curw: *mut winlink,
    pub lastw: winlink_stack,
    pub windows: winlinks,
    pub statusat: libc::c_int,
    pub statuslines: u_int,
    pub options: *mut options,
    pub flags: libc::c_int,
    pub attached: u_int,
    pub tio: *mut termios,
    pub environ: *mut environ,
    pub references: libc::c_int,
    pub gentry: C2RustUnnamed_13,
    pub entry: C2RustUnnamed_12,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_12 {
    pub rbe_left: *mut session,
    pub rbe_right: *mut session,
    pub rbe_parent: *mut session,
    pub rbe_color: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_13 {
    pub tqe_next: *mut session,
    pub tqe_prev: *mut *mut session,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct winlinks {
    pub rbh_root: *mut winlink,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct winlink {
    pub idx: libc::c_int,
    pub session: *mut session,
    pub window: *mut window,
    pub flags: libc::c_int,
    pub entry: C2RustUnnamed_16,
    pub wentry: C2RustUnnamed_15,
    pub sentry: C2RustUnnamed_14,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_14 {
    pub tqe_next: *mut winlink,
    pub tqe_prev: *mut *mut winlink,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_15 {
    pub tqe_next: *mut winlink,
    pub tqe_prev: *mut *mut winlink,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_16 {
    pub rbe_left: *mut winlink,
    pub rbe_right: *mut winlink,
    pub rbe_parent: *mut winlink,
    pub rbe_color: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window {
    pub id: u_int,
    pub latest: *mut libc::c_void,
    pub name: *mut libc::c_char,
    pub name_event: event,
    pub name_time: timeval,
    pub alerts_timer: event,
    pub offset_timer: event,
    pub activity_time: timeval,
    pub active: *mut window_pane,
    pub last_panes: window_panes,
    pub panes: window_panes,
    pub lastlayout: libc::c_int,
    pub layout_root: *mut layout_cell,
    pub saved_layout_root: *mut layout_cell,
    pub old_layout: *mut libc::c_char,
    pub sx: u_int,
    pub sy: u_int,
    pub manual_sx: u_int,
    pub manual_sy: u_int,
    pub xpixel: u_int,
    pub ypixel: u_int,
    pub new_sx: u_int,
    pub new_sy: u_int,
    pub new_xpixel: u_int,
    pub new_ypixel: u_int,
    pub fill_character: *mut utf8_data,
    pub flags: libc::c_int,
    pub alerts_queued: libc::c_int,
    pub alerts_entry: C2RustUnnamed_19,
    pub options: *mut options,
    pub references: u_int,
    pub winlinks: C2RustUnnamed_18,
    pub entry: C2RustUnnamed_17,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_17 {
    pub rbe_left: *mut window,
    pub rbe_right: *mut window,
    pub rbe_parent: *mut window,
    pub rbe_color: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_18 {
    pub tqh_first: *mut winlink,
    pub tqh_last: *mut *mut winlink,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_19 {
    pub tqe_next: *mut window,
    pub tqe_prev: *mut *mut window,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct layout_cell {
    pub type_0: layout_type,
    pub parent: *mut layout_cell,
    pub sx: u_int,
    pub sy: u_int,
    pub xoff: u_int,
    pub yoff: u_int,
    pub wp: *mut window_pane,
    pub cells: layout_cells,
    pub entry: C2RustUnnamed_20,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_20 {
    pub tqe_next: *mut layout_cell,
    pub tqe_prev: *mut *mut layout_cell,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct layout_cells {
    pub tqh_first: *mut layout_cell,
    pub tqh_last: *mut *mut layout_cell,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_pane {
    pub id: u_int,
    pub active_point: u_int,
    pub window: *mut window,
    pub options: *mut options,
    pub layout_cell: *mut layout_cell,
    pub saved_layout_cell: *mut layout_cell,
    pub sx: u_int,
    pub sy: u_int,
    pub xoff: u_int,
    pub yoff: u_int,
    pub flags: libc::c_int,
    pub sb_slider_y: u_int,
    pub sb_slider_h: u_int,
    pub argc: libc::c_int,
    pub argv: *mut *mut libc::c_char,
    pub shell: *mut libc::c_char,
    pub cwd: *mut libc::c_char,
    pub pid: pid_t,
    pub tty: [libc::c_char; 32],
    pub status: libc::c_int,
    pub dead_time: timeval,
    pub fd: libc::c_int,
    pub event: *mut bufferevent,
    pub offset: window_pane_offset,
    pub base_offset: size_t,
    pub resize_queue: window_pane_resizes,
    pub resize_timer: event,
    pub ictx: *mut input_ctx,
    pub cached_gc: grid_cell,
    pub cached_active_gc: grid_cell,
    pub palette: colour_palette,
    pub pipe_fd: libc::c_int,
    pub pipe_event: *mut bufferevent,
    pub pipe_offset: window_pane_offset,
    pub screen: *mut screen,
    pub base: screen,
    pub status_screen: screen,
    pub status_size: size_t,
    pub modes: C2RustUnnamed_24,
    pub searchstr: *mut libc::c_char,
    pub searchregex: libc::c_int,
    pub border_gc_set: libc::c_int,
    pub border_gc: grid_cell,
    pub control_bg: libc::c_int,
    pub control_fg: libc::c_int,
    pub scrollbar_style: style,
    pub entry: C2RustUnnamed_23,
    pub sentry: C2RustUnnamed_22,
    pub tree_entry: C2RustUnnamed_21,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_21 {
    pub rbe_left: *mut window_pane,
    pub rbe_right: *mut window_pane,
    pub rbe_parent: *mut window_pane,
    pub rbe_color: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_22 {
    pub tqe_next: *mut window_pane,
    pub tqe_prev: *mut *mut window_pane,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_23 {
    pub tqe_next: *mut window_pane,
    pub tqe_prev: *mut *mut window_pane,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct style {
    pub gc: grid_cell,
    pub ignore: libc::c_int,
    pub fill: libc::c_int,
    pub align: style_align,
    pub list: style_list,
    pub range_type: style_range_type,
    pub range_argument: u_int,
    pub range_string: [libc::c_char; 16],
    pub width: libc::c_int,
    pub pad: libc::c_int,
    pub default_type: style_default_type,
}
pub type style_default_type = libc::c_uint;
pub const STYLE_DEFAULT_POP: style_default_type = 2;
pub const STYLE_DEFAULT_PUSH: style_default_type = 1;
pub const STYLE_DEFAULT_BASE: style_default_type = 0;
pub type style_range_type = libc::c_uint;
pub const STYLE_RANGE_USER: style_range_type = 6;
pub const STYLE_RANGE_SESSION: style_range_type = 5;
pub const STYLE_RANGE_WINDOW: style_range_type = 4;
pub const STYLE_RANGE_PANE: style_range_type = 3;
pub const STYLE_RANGE_RIGHT: style_range_type = 2;
pub const STYLE_RANGE_LEFT: style_range_type = 1;
pub const STYLE_RANGE_NONE: style_range_type = 0;
pub type style_list = libc::c_uint;
pub const STYLE_LIST_RIGHT_MARKER: style_list = 4;
pub const STYLE_LIST_LEFT_MARKER: style_list = 3;
pub const STYLE_LIST_FOCUS: style_list = 2;
pub const STYLE_LIST_ON: style_list = 1;
pub const STYLE_LIST_OFF: style_list = 0;
pub type style_align = libc::c_uint;
pub const STYLE_ALIGN_ABSOLUTE_CENTRE: style_align = 4;
pub const STYLE_ALIGN_RIGHT: style_align = 3;
pub const STYLE_ALIGN_CENTRE: style_align = 2;
pub const STYLE_ALIGN_LEFT: style_align = 1;
pub const STYLE_ALIGN_DEFAULT: style_align = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_24 {
    pub tqh_first: *mut window_mode_entry,
    pub tqh_last: *mut *mut window_mode_entry,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_mode_entry {
    pub wp: *mut window_pane,
    pub swp: *mut window_pane,
    pub mode: *const window_mode,
    pub data: *mut libc::c_void,
    pub screen: *mut screen,
    pub prefix: u_int,
    pub entry: C2RustUnnamed_25,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_25 {
    pub tqe_next: *mut window_mode_entry,
    pub tqe_prev: *mut *mut window_mode_entry,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_mode {
    pub name: *const libc::c_char,
    pub default_format: *const libc::c_char,
    pub init: Option<
        unsafe extern "C" fn(*mut window_mode_entry, *mut cmd_find_state, *mut args) -> *mut screen,
    >,
    pub free: Option<unsafe extern "C" fn(*mut window_mode_entry) -> ()>,
    pub resize: Option<unsafe extern "C" fn(*mut window_mode_entry, u_int, u_int) -> ()>,
    pub update: Option<unsafe extern "C" fn(*mut window_mode_entry) -> ()>,
    pub key: Option<
        unsafe extern "C" fn(
            *mut window_mode_entry,
            *mut client,
            *mut session,
            *mut winlink,
            key_code,
            *mut mouse_event,
        ) -> (),
    >,
    pub key_table: Option<unsafe extern "C" fn(*mut window_mode_entry) -> *const libc::c_char>,
    pub command: Option<
        unsafe extern "C" fn(
            *mut window_mode_entry,
            *mut client,
            *mut session,
            *mut winlink,
            *mut args,
            *mut mouse_event,
        ) -> (),
    >,
    pub formats: Option<unsafe extern "C" fn(*mut window_mode_entry, *mut format_tree) -> ()>,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct cmd_find_state {
    pub flags: libc::c_int,
    pub current: *mut cmd_find_state,
    pub s: *mut session,
    pub wl: *mut winlink,
    pub w: *mut window,
    pub wp: *mut window_pane,
    pub idx: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_pane_offset {
    pub used: size_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct colour_palette {
    pub fg: libc::c_int,
    pub bg: libc::c_int,
    pub palette: *mut libc::c_int,
    pub default_palette: *mut libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_pane_resizes {
    pub tqh_first: *mut window_pane_resize,
    pub tqh_last: *mut *mut window_pane_resize,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_pane_resize {
    pub sx: u_int,
    pub sy: u_int,
    pub osx: u_int,
    pub osy: u_int,
    pub entry: C2RustUnnamed_26,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_26 {
    pub tqe_next: *mut window_pane_resize,
    pub tqe_prev: *mut *mut window_pane_resize,
}
pub type layout_type = libc::c_uint;
pub const LAYOUT_WINDOWPANE: layout_type = 2;
pub const LAYOUT_TOPBOTTOM: layout_type = 1;
pub const LAYOUT_LEFTRIGHT: layout_type = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct window_panes {
    pub tqh_first: *mut window_pane,
    pub tqh_last: *mut *mut window_pane,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct winlink_stack {
    pub tqh_first: *mut winlink,
    pub tqh_last: *mut *mut winlink,
}
pub type prompt_type = libc::c_uint;
pub const PROMPT_TYPE_INVALID: prompt_type = 255;
pub const PROMPT_TYPE_WINDOW_TARGET: prompt_type = 3;
pub const PROMPT_TYPE_TARGET: prompt_type = 2;
pub const PROMPT_TYPE_SEARCH: prompt_type = 1;
pub const PROMPT_TYPE_COMMAND: prompt_type = 0;
pub type C2RustUnnamed_27 = libc::c_uint;
pub const PROMPT_COMMAND: C2RustUnnamed_27 = 1;
pub const PROMPT_ENTRY: C2RustUnnamed_27 = 0;
pub type prompt_free_cb = Option<unsafe extern "C" fn(*mut libc::c_void) -> ()>;
pub type prompt_input_cb = Option<
    unsafe extern "C" fn(
        *mut client,
        *mut libc::c_void,
        *const libc::c_char,
        libc::c_int,
    ) -> libc::c_int,
>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct key_table {
    pub name: *const libc::c_char,
    pub activity_time: timeval,
    pub key_bindings: key_bindings,
    pub default_key_bindings: key_bindings,
    pub references: u_int,
    pub entry: C2RustUnnamed_28,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_28 {
    pub rbe_left: *mut key_table,
    pub rbe_right: *mut key_table,
    pub rbe_parent: *mut key_table,
    pub rbe_color: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct key_bindings {
    pub rbh_root: *mut key_binding,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct key_binding {
    pub key: key_code,
    pub cmdlist: *mut cmd_list,
    pub note: *const libc::c_char,
    pub flags: libc::c_int,
    pub entry: C2RustUnnamed_29,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_29 {
    pub rbe_left: *mut key_binding,
    pub rbe_right: *mut key_binding,
    pub rbe_parent: *mut key_binding,
    pub rbe_color: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct cmd_list {
    pub references: libc::c_int,
    pub group: u_int,
    pub list: *mut cmds,
}
pub type C2RustUnnamed_30 = libc::c_uint;
pub const CLIENT_EXIT_DETACH: C2RustUnnamed_30 = 2;
pub const CLIENT_EXIT_SHUTDOWN: C2RustUnnamed_30 = 1;
pub const CLIENT_EXIT_RETURN: C2RustUnnamed_30 = 0;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct status_line {
    pub timer: event,
    pub screen: screen,
    pub active: *mut screen,
    pub references: libc::c_int,
    pub style: grid_cell,
    pub entries: [status_line_entry; 5],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct status_line_entry {
    pub expanded: *mut libc::c_char,
    pub ranges: style_ranges,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct style_ranges {
    pub tqh_first: *mut style_range,
    pub tqh_last: *mut *mut style_range,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct style_range {
    pub type_0: style_range_type,
    pub argument: u_int,
    pub string: [libc::c_char; 16],
    pub start: u_int,
    pub end: u_int,
    pub entry: C2RustUnnamed_31,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_31 {
    pub tqe_next: *mut style_range,
    pub tqe_prev: *mut *mut style_range,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct tty {
    pub client: *mut client,
    pub start_timer: event,
    pub clipboard_timer: event,
    pub last_requests: time_t,
    pub sx: u_int,
    pub sy: u_int,
    pub xpixel: u_int,
    pub ypixel: u_int,
    pub cx: u_int,
    pub cy: u_int,
    pub cstyle: screen_cursor_style,
    pub ccolour: libc::c_int,
    pub oflag: libc::c_int,
    pub oox: u_int,
    pub ooy: u_int,
    pub osx: u_int,
    pub osy: u_int,
    pub mode: libc::c_int,
    pub fg: libc::c_int,
    pub bg: libc::c_int,
    pub rlower: u_int,
    pub rupper: u_int,
    pub rleft: u_int,
    pub rright: u_int,
    pub event_in: event,
    pub in_0: *mut evbuffer,
    pub event_out: event,
    pub out: *mut evbuffer,
    pub timer: event,
    pub discarded: size_t,
    pub tio: termios,
    pub cell: grid_cell,
    pub last_cell: grid_cell,
    pub flags: libc::c_int,
    pub term: *mut tty_term,
    pub mouse_last_x: u_int,
    pub mouse_last_y: u_int,
    pub mouse_last_b: u_int,
    pub mouse_drag_flag: libc::c_int,
    pub mouse_scrolling_flag: libc::c_int,
    pub mouse_slider_mpos: libc::c_int,
    pub mouse_drag_update: Option<unsafe extern "C" fn(*mut client, *mut mouse_event) -> ()>,
    pub mouse_drag_release: Option<unsafe extern "C" fn(*mut client, *mut mouse_event) -> ()>,
    pub key_timer: event,
    pub key_tree: *mut tty_key,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct tty_term {
    pub name: *mut libc::c_char,
    pub tty: *mut tty,
    pub features: libc::c_int,
    pub acs: [[libc::c_char; 2]; 256],
    pub codes: *mut tty_code,
    pub flags: libc::c_int,
    pub entry: C2RustUnnamed_32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_32 {
    pub le_next: *mut tty_term,
    pub le_prev: *mut *mut tty_term,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client_windows {
    pub rbh_root: *mut client_window,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct client_window {
    pub window: u_int,
    pub pane: *mut window_pane,
    pub sx: u_int,
    pub sy: u_int,
    pub entry: C2RustUnnamed_33,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct C2RustUnnamed_33 {
    pub rbe_left: *mut client_window,
    pub rbe_right: *mut client_window,
    pub rbe_parent: *mut client_window,
    pub rbe_color: libc::c_int,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct screen_write_ctx {
    pub wp: *mut window_pane,
    pub s: *mut screen,
    pub flags: libc::c_int,
    pub init_ctx_cb: screen_write_init_ctx_cb,
    pub arg: *mut libc::c_void,
    pub item: *mut screen_write_citem,
    pub scrolled: u_int,
    pub bg: u_int,
}
pub type screen_write_init_ctx_cb =
    Option<unsafe extern "C" fn(*mut screen_write_ctx, *mut tty_ctx) -> ()>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct tty_ctx {
    pub s: *mut screen,
    pub redraw_cb: tty_ctx_redraw_cb,
    pub set_client_cb: tty_ctx_set_client_cb,
    pub arg: *mut libc::c_void,
    pub cell: *const grid_cell,
    pub wrapped: libc::c_int,
    pub num: u_int,
    pub ptr: *mut libc::c_void,
    pub ptr2: *mut libc::c_void,
    pub allow_invisible_panes: libc::c_int,
    pub ocx: u_int,
    pub ocy: u_int,
    pub orupper: u_int,
    pub orlower: u_int,
    pub xoff: u_int,
    pub yoff: u_int,
    pub rxoff: u_int,
    pub ryoff: u_int,
    pub sx: u_int,
    pub sy: u_int,
    pub bg: u_int,
    pub defaults: grid_cell,
    pub palette: *mut colour_palette,
    pub bigger: libc::c_int,
    pub wox: u_int,
    pub woy: u_int,
    pub wsx: u_int,
    pub wsy: u_int,
}
pub type tty_ctx_set_client_cb =
    Option<unsafe extern "C" fn(*mut tty_ctx, *mut client) -> libc::c_int>;
pub type tty_ctx_redraw_cb = Option<unsafe extern "C" fn(*const tty_ctx) -> ()>;
pub type C2RustUnnamed_34 = libc::c_uint;
pub const KEYC_BASE_END: C2RustUnnamed_34 = 1106562;
pub const KEYC_KP_PERIOD: C2RustUnnamed_34 = 1106561;
pub const KEYC_KP_ZERO: C2RustUnnamed_34 = 1106560;
pub const KEYC_KP_ENTER: C2RustUnnamed_34 = 1106559;
pub const KEYC_KP_THREE: C2RustUnnamed_34 = 1106558;
pub const KEYC_KP_TWO: C2RustUnnamed_34 = 1106557;
pub const KEYC_KP_ONE: C2RustUnnamed_34 = 1106556;
pub const KEYC_KP_SIX: C2RustUnnamed_34 = 1106555;
pub const KEYC_KP_FIVE: C2RustUnnamed_34 = 1106554;
pub const KEYC_KP_FOUR: C2RustUnnamed_34 = 1106553;
pub const KEYC_KP_PLUS: C2RustUnnamed_34 = 1106552;
pub const KEYC_KP_NINE: C2RustUnnamed_34 = 1106551;
pub const KEYC_KP_EIGHT: C2RustUnnamed_34 = 1106550;
pub const KEYC_KP_SEVEN: C2RustUnnamed_34 = 1106549;
pub const KEYC_KP_MINUS: C2RustUnnamed_34 = 1106548;
pub const KEYC_KP_STAR: C2RustUnnamed_34 = 1106547;
pub const KEYC_KP_SLASH: C2RustUnnamed_34 = 1106546;
pub const KEYC_RIGHT: C2RustUnnamed_34 = 1106545;
pub const KEYC_LEFT: C2RustUnnamed_34 = 1106544;
pub const KEYC_DOWN: C2RustUnnamed_34 = 1106543;
pub const KEYC_UP: C2RustUnnamed_34 = 1106542;
pub const KEYC_BTAB: C2RustUnnamed_34 = 1106541;
pub const KEYC_PPAGE: C2RustUnnamed_34 = 1106540;
pub const KEYC_NPAGE: C2RustUnnamed_34 = 1106539;
pub const KEYC_END: C2RustUnnamed_34 = 1106538;
pub const KEYC_HOME: C2RustUnnamed_34 = 1106537;
pub const KEYC_DC: C2RustUnnamed_34 = 1106536;
pub const KEYC_IC: C2RustUnnamed_34 = 1106535;
pub const KEYC_F12: C2RustUnnamed_34 = 1106534;
pub const KEYC_F11: C2RustUnnamed_34 = 1106533;
pub const KEYC_F10: C2RustUnnamed_34 = 1106532;
pub const KEYC_F9: C2RustUnnamed_34 = 1106531;
pub const KEYC_F8: C2RustUnnamed_34 = 1106530;
pub const KEYC_F7: C2RustUnnamed_34 = 1106529;
pub const KEYC_F6: C2RustUnnamed_34 = 1106528;
pub const KEYC_F5: C2RustUnnamed_34 = 1106527;
pub const KEYC_F4: C2RustUnnamed_34 = 1106526;
pub const KEYC_F3: C2RustUnnamed_34 = 1106525;
pub const KEYC_F2: C2RustUnnamed_34 = 1106524;
pub const KEYC_F1: C2RustUnnamed_34 = 1106523;
pub const KEYC_BSPACE: C2RustUnnamed_34 = 1106522;
pub const KEYC_TRIPLECLICK11_BORDER: C2RustUnnamed_34 = 1106521;
pub const KEYC_TRIPLECLICK11_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106520;
pub const KEYC_TRIPLECLICK11_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106519;
pub const KEYC_TRIPLECLICK11_SCROLLBAR_UP: C2RustUnnamed_34 = 1106518;
pub const KEYC_TRIPLECLICK11_STATUS_DEFAULT: C2RustUnnamed_34 = 1106517;
pub const KEYC_TRIPLECLICK11_STATUS_RIGHT: C2RustUnnamed_34 = 1106516;
pub const KEYC_TRIPLECLICK11_STATUS_LEFT: C2RustUnnamed_34 = 1106515;
pub const KEYC_TRIPLECLICK11_STATUS: C2RustUnnamed_34 = 1106514;
pub const KEYC_TRIPLECLICK11_PANE: C2RustUnnamed_34 = 1106513;
pub const KEYC_TRIPLECLICK10_BORDER: C2RustUnnamed_34 = 1106512;
pub const KEYC_TRIPLECLICK10_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106511;
pub const KEYC_TRIPLECLICK10_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106510;
pub const KEYC_TRIPLECLICK10_SCROLLBAR_UP: C2RustUnnamed_34 = 1106509;
pub const KEYC_TRIPLECLICK10_STATUS_DEFAULT: C2RustUnnamed_34 = 1106508;
pub const KEYC_TRIPLECLICK10_STATUS_RIGHT: C2RustUnnamed_34 = 1106507;
pub const KEYC_TRIPLECLICK10_STATUS_LEFT: C2RustUnnamed_34 = 1106506;
pub const KEYC_TRIPLECLICK10_STATUS: C2RustUnnamed_34 = 1106505;
pub const KEYC_TRIPLECLICK10_PANE: C2RustUnnamed_34 = 1106504;
pub const KEYC_TRIPLECLICK9_BORDER: C2RustUnnamed_34 = 1106503;
pub const KEYC_TRIPLECLICK9_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106502;
pub const KEYC_TRIPLECLICK9_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106501;
pub const KEYC_TRIPLECLICK9_SCROLLBAR_UP: C2RustUnnamed_34 = 1106500;
pub const KEYC_TRIPLECLICK9_STATUS_DEFAULT: C2RustUnnamed_34 = 1106499;
pub const KEYC_TRIPLECLICK9_STATUS_RIGHT: C2RustUnnamed_34 = 1106498;
pub const KEYC_TRIPLECLICK9_STATUS_LEFT: C2RustUnnamed_34 = 1106497;
pub const KEYC_TRIPLECLICK9_STATUS: C2RustUnnamed_34 = 1106496;
pub const KEYC_TRIPLECLICK9_PANE: C2RustUnnamed_34 = 1106495;
pub const KEYC_TRIPLECLICK8_BORDER: C2RustUnnamed_34 = 1106494;
pub const KEYC_TRIPLECLICK8_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106493;
pub const KEYC_TRIPLECLICK8_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106492;
pub const KEYC_TRIPLECLICK8_SCROLLBAR_UP: C2RustUnnamed_34 = 1106491;
pub const KEYC_TRIPLECLICK8_STATUS_DEFAULT: C2RustUnnamed_34 = 1106490;
pub const KEYC_TRIPLECLICK8_STATUS_RIGHT: C2RustUnnamed_34 = 1106489;
pub const KEYC_TRIPLECLICK8_STATUS_LEFT: C2RustUnnamed_34 = 1106488;
pub const KEYC_TRIPLECLICK8_STATUS: C2RustUnnamed_34 = 1106487;
pub const KEYC_TRIPLECLICK8_PANE: C2RustUnnamed_34 = 1106486;
pub const KEYC_TRIPLECLICK7_BORDER: C2RustUnnamed_34 = 1106485;
pub const KEYC_TRIPLECLICK7_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106484;
pub const KEYC_TRIPLECLICK7_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106483;
pub const KEYC_TRIPLECLICK7_SCROLLBAR_UP: C2RustUnnamed_34 = 1106482;
pub const KEYC_TRIPLECLICK7_STATUS_DEFAULT: C2RustUnnamed_34 = 1106481;
pub const KEYC_TRIPLECLICK7_STATUS_RIGHT: C2RustUnnamed_34 = 1106480;
pub const KEYC_TRIPLECLICK7_STATUS_LEFT: C2RustUnnamed_34 = 1106479;
pub const KEYC_TRIPLECLICK7_STATUS: C2RustUnnamed_34 = 1106478;
pub const KEYC_TRIPLECLICK7_PANE: C2RustUnnamed_34 = 1106477;
pub const KEYC_TRIPLECLICK6_BORDER: C2RustUnnamed_34 = 1106476;
pub const KEYC_TRIPLECLICK6_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106475;
pub const KEYC_TRIPLECLICK6_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106474;
pub const KEYC_TRIPLECLICK6_SCROLLBAR_UP: C2RustUnnamed_34 = 1106473;
pub const KEYC_TRIPLECLICK6_STATUS_DEFAULT: C2RustUnnamed_34 = 1106472;
pub const KEYC_TRIPLECLICK6_STATUS_RIGHT: C2RustUnnamed_34 = 1106471;
pub const KEYC_TRIPLECLICK6_STATUS_LEFT: C2RustUnnamed_34 = 1106470;
pub const KEYC_TRIPLECLICK6_STATUS: C2RustUnnamed_34 = 1106469;
pub const KEYC_TRIPLECLICK6_PANE: C2RustUnnamed_34 = 1106468;
pub const KEYC_TRIPLECLICK3_BORDER: C2RustUnnamed_34 = 1106467;
pub const KEYC_TRIPLECLICK3_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106466;
pub const KEYC_TRIPLECLICK3_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106465;
pub const KEYC_TRIPLECLICK3_SCROLLBAR_UP: C2RustUnnamed_34 = 1106464;
pub const KEYC_TRIPLECLICK3_STATUS_DEFAULT: C2RustUnnamed_34 = 1106463;
pub const KEYC_TRIPLECLICK3_STATUS_RIGHT: C2RustUnnamed_34 = 1106462;
pub const KEYC_TRIPLECLICK3_STATUS_LEFT: C2RustUnnamed_34 = 1106461;
pub const KEYC_TRIPLECLICK3_STATUS: C2RustUnnamed_34 = 1106460;
pub const KEYC_TRIPLECLICK3_PANE: C2RustUnnamed_34 = 1106459;
pub const KEYC_TRIPLECLICK2_BORDER: C2RustUnnamed_34 = 1106458;
pub const KEYC_TRIPLECLICK2_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106457;
pub const KEYC_TRIPLECLICK2_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106456;
pub const KEYC_TRIPLECLICK2_SCROLLBAR_UP: C2RustUnnamed_34 = 1106455;
pub const KEYC_TRIPLECLICK2_STATUS_DEFAULT: C2RustUnnamed_34 = 1106454;
pub const KEYC_TRIPLECLICK2_STATUS_RIGHT: C2RustUnnamed_34 = 1106453;
pub const KEYC_TRIPLECLICK2_STATUS_LEFT: C2RustUnnamed_34 = 1106452;
pub const KEYC_TRIPLECLICK2_STATUS: C2RustUnnamed_34 = 1106451;
pub const KEYC_TRIPLECLICK2_PANE: C2RustUnnamed_34 = 1106450;
pub const KEYC_TRIPLECLICK1_BORDER: C2RustUnnamed_34 = 1106449;
pub const KEYC_TRIPLECLICK1_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106448;
pub const KEYC_TRIPLECLICK1_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106447;
pub const KEYC_TRIPLECLICK1_SCROLLBAR_UP: C2RustUnnamed_34 = 1106446;
pub const KEYC_TRIPLECLICK1_STATUS_DEFAULT: C2RustUnnamed_34 = 1106445;
pub const KEYC_TRIPLECLICK1_STATUS_RIGHT: C2RustUnnamed_34 = 1106444;
pub const KEYC_TRIPLECLICK1_STATUS_LEFT: C2RustUnnamed_34 = 1106443;
pub const KEYC_TRIPLECLICK1_STATUS: C2RustUnnamed_34 = 1106442;
pub const KEYC_TRIPLECLICK1_PANE: C2RustUnnamed_34 = 1106441;
pub const KEYC_DOUBLECLICK11_BORDER: C2RustUnnamed_34 = 1106440;
pub const KEYC_DOUBLECLICK11_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106439;
pub const KEYC_DOUBLECLICK11_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106438;
pub const KEYC_DOUBLECLICK11_SCROLLBAR_UP: C2RustUnnamed_34 = 1106437;
pub const KEYC_DOUBLECLICK11_STATUS_DEFAULT: C2RustUnnamed_34 = 1106436;
pub const KEYC_DOUBLECLICK11_STATUS_RIGHT: C2RustUnnamed_34 = 1106435;
pub const KEYC_DOUBLECLICK11_STATUS_LEFT: C2RustUnnamed_34 = 1106434;
pub const KEYC_DOUBLECLICK11_STATUS: C2RustUnnamed_34 = 1106433;
pub const KEYC_DOUBLECLICK11_PANE: C2RustUnnamed_34 = 1106432;
pub const KEYC_DOUBLECLICK10_BORDER: C2RustUnnamed_34 = 1106431;
pub const KEYC_DOUBLECLICK10_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106430;
pub const KEYC_DOUBLECLICK10_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106429;
pub const KEYC_DOUBLECLICK10_SCROLLBAR_UP: C2RustUnnamed_34 = 1106428;
pub const KEYC_DOUBLECLICK10_STATUS_DEFAULT: C2RustUnnamed_34 = 1106427;
pub const KEYC_DOUBLECLICK10_STATUS_RIGHT: C2RustUnnamed_34 = 1106426;
pub const KEYC_DOUBLECLICK10_STATUS_LEFT: C2RustUnnamed_34 = 1106425;
pub const KEYC_DOUBLECLICK10_STATUS: C2RustUnnamed_34 = 1106424;
pub const KEYC_DOUBLECLICK10_PANE: C2RustUnnamed_34 = 1106423;
pub const KEYC_DOUBLECLICK9_BORDER: C2RustUnnamed_34 = 1106422;
pub const KEYC_DOUBLECLICK9_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106421;
pub const KEYC_DOUBLECLICK9_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106420;
pub const KEYC_DOUBLECLICK9_SCROLLBAR_UP: C2RustUnnamed_34 = 1106419;
pub const KEYC_DOUBLECLICK9_STATUS_DEFAULT: C2RustUnnamed_34 = 1106418;
pub const KEYC_DOUBLECLICK9_STATUS_RIGHT: C2RustUnnamed_34 = 1106417;
pub const KEYC_DOUBLECLICK9_STATUS_LEFT: C2RustUnnamed_34 = 1106416;
pub const KEYC_DOUBLECLICK9_STATUS: C2RustUnnamed_34 = 1106415;
pub const KEYC_DOUBLECLICK9_PANE: C2RustUnnamed_34 = 1106414;
pub const KEYC_DOUBLECLICK8_BORDER: C2RustUnnamed_34 = 1106413;
pub const KEYC_DOUBLECLICK8_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106412;
pub const KEYC_DOUBLECLICK8_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106411;
pub const KEYC_DOUBLECLICK8_SCROLLBAR_UP: C2RustUnnamed_34 = 1106410;
pub const KEYC_DOUBLECLICK8_STATUS_DEFAULT: C2RustUnnamed_34 = 1106409;
pub const KEYC_DOUBLECLICK8_STATUS_RIGHT: C2RustUnnamed_34 = 1106408;
pub const KEYC_DOUBLECLICK8_STATUS_LEFT: C2RustUnnamed_34 = 1106407;
pub const KEYC_DOUBLECLICK8_STATUS: C2RustUnnamed_34 = 1106406;
pub const KEYC_DOUBLECLICK8_PANE: C2RustUnnamed_34 = 1106405;
pub const KEYC_DOUBLECLICK7_BORDER: C2RustUnnamed_34 = 1106404;
pub const KEYC_DOUBLECLICK7_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106403;
pub const KEYC_DOUBLECLICK7_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106402;
pub const KEYC_DOUBLECLICK7_SCROLLBAR_UP: C2RustUnnamed_34 = 1106401;
pub const KEYC_DOUBLECLICK7_STATUS_DEFAULT: C2RustUnnamed_34 = 1106400;
pub const KEYC_DOUBLECLICK7_STATUS_RIGHT: C2RustUnnamed_34 = 1106399;
pub const KEYC_DOUBLECLICK7_STATUS_LEFT: C2RustUnnamed_34 = 1106398;
pub const KEYC_DOUBLECLICK7_STATUS: C2RustUnnamed_34 = 1106397;
pub const KEYC_DOUBLECLICK7_PANE: C2RustUnnamed_34 = 1106396;
pub const KEYC_DOUBLECLICK6_BORDER: C2RustUnnamed_34 = 1106395;
pub const KEYC_DOUBLECLICK6_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106394;
pub const KEYC_DOUBLECLICK6_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106393;
pub const KEYC_DOUBLECLICK6_SCROLLBAR_UP: C2RustUnnamed_34 = 1106392;
pub const KEYC_DOUBLECLICK6_STATUS_DEFAULT: C2RustUnnamed_34 = 1106391;
pub const KEYC_DOUBLECLICK6_STATUS_RIGHT: C2RustUnnamed_34 = 1106390;
pub const KEYC_DOUBLECLICK6_STATUS_LEFT: C2RustUnnamed_34 = 1106389;
pub const KEYC_DOUBLECLICK6_STATUS: C2RustUnnamed_34 = 1106388;
pub const KEYC_DOUBLECLICK6_PANE: C2RustUnnamed_34 = 1106387;
pub const KEYC_DOUBLECLICK3_BORDER: C2RustUnnamed_34 = 1106386;
pub const KEYC_DOUBLECLICK3_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106385;
pub const KEYC_DOUBLECLICK3_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106384;
pub const KEYC_DOUBLECLICK3_SCROLLBAR_UP: C2RustUnnamed_34 = 1106383;
pub const KEYC_DOUBLECLICK3_STATUS_DEFAULT: C2RustUnnamed_34 = 1106382;
pub const KEYC_DOUBLECLICK3_STATUS_RIGHT: C2RustUnnamed_34 = 1106381;
pub const KEYC_DOUBLECLICK3_STATUS_LEFT: C2RustUnnamed_34 = 1106380;
pub const KEYC_DOUBLECLICK3_STATUS: C2RustUnnamed_34 = 1106379;
pub const KEYC_DOUBLECLICK3_PANE: C2RustUnnamed_34 = 1106378;
pub const KEYC_DOUBLECLICK2_BORDER: C2RustUnnamed_34 = 1106377;
pub const KEYC_DOUBLECLICK2_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106376;
pub const KEYC_DOUBLECLICK2_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106375;
pub const KEYC_DOUBLECLICK2_SCROLLBAR_UP: C2RustUnnamed_34 = 1106374;
pub const KEYC_DOUBLECLICK2_STATUS_DEFAULT: C2RustUnnamed_34 = 1106373;
pub const KEYC_DOUBLECLICK2_STATUS_RIGHT: C2RustUnnamed_34 = 1106372;
pub const KEYC_DOUBLECLICK2_STATUS_LEFT: C2RustUnnamed_34 = 1106371;
pub const KEYC_DOUBLECLICK2_STATUS: C2RustUnnamed_34 = 1106370;
pub const KEYC_DOUBLECLICK2_PANE: C2RustUnnamed_34 = 1106369;
pub const KEYC_DOUBLECLICK1_BORDER: C2RustUnnamed_34 = 1106368;
pub const KEYC_DOUBLECLICK1_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106367;
pub const KEYC_DOUBLECLICK1_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106366;
pub const KEYC_DOUBLECLICK1_SCROLLBAR_UP: C2RustUnnamed_34 = 1106365;
pub const KEYC_DOUBLECLICK1_STATUS_DEFAULT: C2RustUnnamed_34 = 1106364;
pub const KEYC_DOUBLECLICK1_STATUS_RIGHT: C2RustUnnamed_34 = 1106363;
pub const KEYC_DOUBLECLICK1_STATUS_LEFT: C2RustUnnamed_34 = 1106362;
pub const KEYC_DOUBLECLICK1_STATUS: C2RustUnnamed_34 = 1106361;
pub const KEYC_DOUBLECLICK1_PANE: C2RustUnnamed_34 = 1106360;
pub const KEYC_SECONDCLICK11_BORDER: C2RustUnnamed_34 = 1106359;
pub const KEYC_SECONDCLICK11_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106358;
pub const KEYC_SECONDCLICK11_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106357;
pub const KEYC_SECONDCLICK11_SCROLLBAR_UP: C2RustUnnamed_34 = 1106356;
pub const KEYC_SECONDCLICK11_STATUS_DEFAULT: C2RustUnnamed_34 = 1106355;
pub const KEYC_SECONDCLICK11_STATUS_RIGHT: C2RustUnnamed_34 = 1106354;
pub const KEYC_SECONDCLICK11_STATUS_LEFT: C2RustUnnamed_34 = 1106353;
pub const KEYC_SECONDCLICK11_STATUS: C2RustUnnamed_34 = 1106352;
pub const KEYC_SECONDCLICK11_PANE: C2RustUnnamed_34 = 1106351;
pub const KEYC_SECONDCLICK10_BORDER: C2RustUnnamed_34 = 1106350;
pub const KEYC_SECONDCLICK10_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106349;
pub const KEYC_SECONDCLICK10_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106348;
pub const KEYC_SECONDCLICK10_SCROLLBAR_UP: C2RustUnnamed_34 = 1106347;
pub const KEYC_SECONDCLICK10_STATUS_DEFAULT: C2RustUnnamed_34 = 1106346;
pub const KEYC_SECONDCLICK10_STATUS_RIGHT: C2RustUnnamed_34 = 1106345;
pub const KEYC_SECONDCLICK10_STATUS_LEFT: C2RustUnnamed_34 = 1106344;
pub const KEYC_SECONDCLICK10_STATUS: C2RustUnnamed_34 = 1106343;
pub const KEYC_SECONDCLICK10_PANE: C2RustUnnamed_34 = 1106342;
pub const KEYC_SECONDCLICK9_BORDER: C2RustUnnamed_34 = 1106341;
pub const KEYC_SECONDCLICK9_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106340;
pub const KEYC_SECONDCLICK9_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106339;
pub const KEYC_SECONDCLICK9_SCROLLBAR_UP: C2RustUnnamed_34 = 1106338;
pub const KEYC_SECONDCLICK9_STATUS_DEFAULT: C2RustUnnamed_34 = 1106337;
pub const KEYC_SECONDCLICK9_STATUS_RIGHT: C2RustUnnamed_34 = 1106336;
pub const KEYC_SECONDCLICK9_STATUS_LEFT: C2RustUnnamed_34 = 1106335;
pub const KEYC_SECONDCLICK9_STATUS: C2RustUnnamed_34 = 1106334;
pub const KEYC_SECONDCLICK9_PANE: C2RustUnnamed_34 = 1106333;
pub const KEYC_SECONDCLICK8_BORDER: C2RustUnnamed_34 = 1106332;
pub const KEYC_SECONDCLICK8_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106331;
pub const KEYC_SECONDCLICK8_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106330;
pub const KEYC_SECONDCLICK8_SCROLLBAR_UP: C2RustUnnamed_34 = 1106329;
pub const KEYC_SECONDCLICK8_STATUS_DEFAULT: C2RustUnnamed_34 = 1106328;
pub const KEYC_SECONDCLICK8_STATUS_RIGHT: C2RustUnnamed_34 = 1106327;
pub const KEYC_SECONDCLICK8_STATUS_LEFT: C2RustUnnamed_34 = 1106326;
pub const KEYC_SECONDCLICK8_STATUS: C2RustUnnamed_34 = 1106325;
pub const KEYC_SECONDCLICK8_PANE: C2RustUnnamed_34 = 1106324;
pub const KEYC_SECONDCLICK7_BORDER: C2RustUnnamed_34 = 1106323;
pub const KEYC_SECONDCLICK7_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106322;
pub const KEYC_SECONDCLICK7_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106321;
pub const KEYC_SECONDCLICK7_SCROLLBAR_UP: C2RustUnnamed_34 = 1106320;
pub const KEYC_SECONDCLICK7_STATUS_DEFAULT: C2RustUnnamed_34 = 1106319;
pub const KEYC_SECONDCLICK7_STATUS_RIGHT: C2RustUnnamed_34 = 1106318;
pub const KEYC_SECONDCLICK7_STATUS_LEFT: C2RustUnnamed_34 = 1106317;
pub const KEYC_SECONDCLICK7_STATUS: C2RustUnnamed_34 = 1106316;
pub const KEYC_SECONDCLICK7_PANE: C2RustUnnamed_34 = 1106315;
pub const KEYC_SECONDCLICK6_BORDER: C2RustUnnamed_34 = 1106314;
pub const KEYC_SECONDCLICK6_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106313;
pub const KEYC_SECONDCLICK6_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106312;
pub const KEYC_SECONDCLICK6_SCROLLBAR_UP: C2RustUnnamed_34 = 1106311;
pub const KEYC_SECONDCLICK6_STATUS_DEFAULT: C2RustUnnamed_34 = 1106310;
pub const KEYC_SECONDCLICK6_STATUS_RIGHT: C2RustUnnamed_34 = 1106309;
pub const KEYC_SECONDCLICK6_STATUS_LEFT: C2RustUnnamed_34 = 1106308;
pub const KEYC_SECONDCLICK6_STATUS: C2RustUnnamed_34 = 1106307;
pub const KEYC_SECONDCLICK6_PANE: C2RustUnnamed_34 = 1106306;
pub const KEYC_SECONDCLICK3_BORDER: C2RustUnnamed_34 = 1106305;
pub const KEYC_SECONDCLICK3_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106304;
pub const KEYC_SECONDCLICK3_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106303;
pub const KEYC_SECONDCLICK3_SCROLLBAR_UP: C2RustUnnamed_34 = 1106302;
pub const KEYC_SECONDCLICK3_STATUS_DEFAULT: C2RustUnnamed_34 = 1106301;
pub const KEYC_SECONDCLICK3_STATUS_RIGHT: C2RustUnnamed_34 = 1106300;
pub const KEYC_SECONDCLICK3_STATUS_LEFT: C2RustUnnamed_34 = 1106299;
pub const KEYC_SECONDCLICK3_STATUS: C2RustUnnamed_34 = 1106298;
pub const KEYC_SECONDCLICK3_PANE: C2RustUnnamed_34 = 1106297;
pub const KEYC_SECONDCLICK2_BORDER: C2RustUnnamed_34 = 1106296;
pub const KEYC_SECONDCLICK2_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106295;
pub const KEYC_SECONDCLICK2_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106294;
pub const KEYC_SECONDCLICK2_SCROLLBAR_UP: C2RustUnnamed_34 = 1106293;
pub const KEYC_SECONDCLICK2_STATUS_DEFAULT: C2RustUnnamed_34 = 1106292;
pub const KEYC_SECONDCLICK2_STATUS_RIGHT: C2RustUnnamed_34 = 1106291;
pub const KEYC_SECONDCLICK2_STATUS_LEFT: C2RustUnnamed_34 = 1106290;
pub const KEYC_SECONDCLICK2_STATUS: C2RustUnnamed_34 = 1106289;
pub const KEYC_SECONDCLICK2_PANE: C2RustUnnamed_34 = 1106288;
pub const KEYC_SECONDCLICK1_BORDER: C2RustUnnamed_34 = 1106287;
pub const KEYC_SECONDCLICK1_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106286;
pub const KEYC_SECONDCLICK1_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106285;
pub const KEYC_SECONDCLICK1_SCROLLBAR_UP: C2RustUnnamed_34 = 1106284;
pub const KEYC_SECONDCLICK1_STATUS_DEFAULT: C2RustUnnamed_34 = 1106283;
pub const KEYC_SECONDCLICK1_STATUS_RIGHT: C2RustUnnamed_34 = 1106282;
pub const KEYC_SECONDCLICK1_STATUS_LEFT: C2RustUnnamed_34 = 1106281;
pub const KEYC_SECONDCLICK1_STATUS: C2RustUnnamed_34 = 1106280;
pub const KEYC_SECONDCLICK1_PANE: C2RustUnnamed_34 = 1106279;
pub const KEYC_WHEELDOWN_BORDER: C2RustUnnamed_34 = 1106278;
pub const KEYC_WHEELDOWN_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106277;
pub const KEYC_WHEELDOWN_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106276;
pub const KEYC_WHEELDOWN_SCROLLBAR_UP: C2RustUnnamed_34 = 1106275;
pub const KEYC_WHEELDOWN_STATUS_DEFAULT: C2RustUnnamed_34 = 1106274;
pub const KEYC_WHEELDOWN_STATUS_RIGHT: C2RustUnnamed_34 = 1106273;
pub const KEYC_WHEELDOWN_STATUS_LEFT: C2RustUnnamed_34 = 1106272;
pub const KEYC_WHEELDOWN_STATUS: C2RustUnnamed_34 = 1106271;
pub const KEYC_WHEELDOWN_PANE: C2RustUnnamed_34 = 1106270;
pub const KEYC_WHEELUP_BORDER: C2RustUnnamed_34 = 1106269;
pub const KEYC_WHEELUP_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106268;
pub const KEYC_WHEELUP_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106267;
pub const KEYC_WHEELUP_SCROLLBAR_UP: C2RustUnnamed_34 = 1106266;
pub const KEYC_WHEELUP_STATUS_DEFAULT: C2RustUnnamed_34 = 1106265;
pub const KEYC_WHEELUP_STATUS_RIGHT: C2RustUnnamed_34 = 1106264;
pub const KEYC_WHEELUP_STATUS_LEFT: C2RustUnnamed_34 = 1106263;
pub const KEYC_WHEELUP_STATUS: C2RustUnnamed_34 = 1106262;
pub const KEYC_WHEELUP_PANE: C2RustUnnamed_34 = 1106261;
pub const KEYC_MOUSEDRAGEND11_BORDER: C2RustUnnamed_34 = 1106260;
pub const KEYC_MOUSEDRAGEND11_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106259;
pub const KEYC_MOUSEDRAGEND11_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106258;
pub const KEYC_MOUSEDRAGEND11_SCROLLBAR_UP: C2RustUnnamed_34 = 1106257;
pub const KEYC_MOUSEDRAGEND11_STATUS_DEFAULT: C2RustUnnamed_34 = 1106256;
pub const KEYC_MOUSEDRAGEND11_STATUS_RIGHT: C2RustUnnamed_34 = 1106255;
pub const KEYC_MOUSEDRAGEND11_STATUS_LEFT: C2RustUnnamed_34 = 1106254;
pub const KEYC_MOUSEDRAGEND11_STATUS: C2RustUnnamed_34 = 1106253;
pub const KEYC_MOUSEDRAGEND11_PANE: C2RustUnnamed_34 = 1106252;
pub const KEYC_MOUSEDRAGEND10_BORDER: C2RustUnnamed_34 = 1106251;
pub const KEYC_MOUSEDRAGEND10_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106250;
pub const KEYC_MOUSEDRAGEND10_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106249;
pub const KEYC_MOUSEDRAGEND10_SCROLLBAR_UP: C2RustUnnamed_34 = 1106248;
pub const KEYC_MOUSEDRAGEND10_STATUS_DEFAULT: C2RustUnnamed_34 = 1106247;
pub const KEYC_MOUSEDRAGEND10_STATUS_RIGHT: C2RustUnnamed_34 = 1106246;
pub const KEYC_MOUSEDRAGEND10_STATUS_LEFT: C2RustUnnamed_34 = 1106245;
pub const KEYC_MOUSEDRAGEND10_STATUS: C2RustUnnamed_34 = 1106244;
pub const KEYC_MOUSEDRAGEND10_PANE: C2RustUnnamed_34 = 1106243;
pub const KEYC_MOUSEDRAGEND9_BORDER: C2RustUnnamed_34 = 1106242;
pub const KEYC_MOUSEDRAGEND9_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106241;
pub const KEYC_MOUSEDRAGEND9_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106240;
pub const KEYC_MOUSEDRAGEND9_SCROLLBAR_UP: C2RustUnnamed_34 = 1106239;
pub const KEYC_MOUSEDRAGEND9_STATUS_DEFAULT: C2RustUnnamed_34 = 1106238;
pub const KEYC_MOUSEDRAGEND9_STATUS_RIGHT: C2RustUnnamed_34 = 1106237;
pub const KEYC_MOUSEDRAGEND9_STATUS_LEFT: C2RustUnnamed_34 = 1106236;
pub const KEYC_MOUSEDRAGEND9_STATUS: C2RustUnnamed_34 = 1106235;
pub const KEYC_MOUSEDRAGEND9_PANE: C2RustUnnamed_34 = 1106234;
pub const KEYC_MOUSEDRAGEND8_BORDER: C2RustUnnamed_34 = 1106233;
pub const KEYC_MOUSEDRAGEND8_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106232;
pub const KEYC_MOUSEDRAGEND8_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106231;
pub const KEYC_MOUSEDRAGEND8_SCROLLBAR_UP: C2RustUnnamed_34 = 1106230;
pub const KEYC_MOUSEDRAGEND8_STATUS_DEFAULT: C2RustUnnamed_34 = 1106229;
pub const KEYC_MOUSEDRAGEND8_STATUS_RIGHT: C2RustUnnamed_34 = 1106228;
pub const KEYC_MOUSEDRAGEND8_STATUS_LEFT: C2RustUnnamed_34 = 1106227;
pub const KEYC_MOUSEDRAGEND8_STATUS: C2RustUnnamed_34 = 1106226;
pub const KEYC_MOUSEDRAGEND8_PANE: C2RustUnnamed_34 = 1106225;
pub const KEYC_MOUSEDRAGEND7_BORDER: C2RustUnnamed_34 = 1106224;
pub const KEYC_MOUSEDRAGEND7_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106223;
pub const KEYC_MOUSEDRAGEND7_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106222;
pub const KEYC_MOUSEDRAGEND7_SCROLLBAR_UP: C2RustUnnamed_34 = 1106221;
pub const KEYC_MOUSEDRAGEND7_STATUS_DEFAULT: C2RustUnnamed_34 = 1106220;
pub const KEYC_MOUSEDRAGEND7_STATUS_RIGHT: C2RustUnnamed_34 = 1106219;
pub const KEYC_MOUSEDRAGEND7_STATUS_LEFT: C2RustUnnamed_34 = 1106218;
pub const KEYC_MOUSEDRAGEND7_STATUS: C2RustUnnamed_34 = 1106217;
pub const KEYC_MOUSEDRAGEND7_PANE: C2RustUnnamed_34 = 1106216;
pub const KEYC_MOUSEDRAGEND6_BORDER: C2RustUnnamed_34 = 1106215;
pub const KEYC_MOUSEDRAGEND6_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106214;
pub const KEYC_MOUSEDRAGEND6_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106213;
pub const KEYC_MOUSEDRAGEND6_SCROLLBAR_UP: C2RustUnnamed_34 = 1106212;
pub const KEYC_MOUSEDRAGEND6_STATUS_DEFAULT: C2RustUnnamed_34 = 1106211;
pub const KEYC_MOUSEDRAGEND6_STATUS_RIGHT: C2RustUnnamed_34 = 1106210;
pub const KEYC_MOUSEDRAGEND6_STATUS_LEFT: C2RustUnnamed_34 = 1106209;
pub const KEYC_MOUSEDRAGEND6_STATUS: C2RustUnnamed_34 = 1106208;
pub const KEYC_MOUSEDRAGEND6_PANE: C2RustUnnamed_34 = 1106207;
pub const KEYC_MOUSEDRAGEND3_BORDER: C2RustUnnamed_34 = 1106206;
pub const KEYC_MOUSEDRAGEND3_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106205;
pub const KEYC_MOUSEDRAGEND3_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106204;
pub const KEYC_MOUSEDRAGEND3_SCROLLBAR_UP: C2RustUnnamed_34 = 1106203;
pub const KEYC_MOUSEDRAGEND3_STATUS_DEFAULT: C2RustUnnamed_34 = 1106202;
pub const KEYC_MOUSEDRAGEND3_STATUS_RIGHT: C2RustUnnamed_34 = 1106201;
pub const KEYC_MOUSEDRAGEND3_STATUS_LEFT: C2RustUnnamed_34 = 1106200;
pub const KEYC_MOUSEDRAGEND3_STATUS: C2RustUnnamed_34 = 1106199;
pub const KEYC_MOUSEDRAGEND3_PANE: C2RustUnnamed_34 = 1106198;
pub const KEYC_MOUSEDRAGEND2_BORDER: C2RustUnnamed_34 = 1106197;
pub const KEYC_MOUSEDRAGEND2_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106196;
pub const KEYC_MOUSEDRAGEND2_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106195;
pub const KEYC_MOUSEDRAGEND2_SCROLLBAR_UP: C2RustUnnamed_34 = 1106194;
pub const KEYC_MOUSEDRAGEND2_STATUS_DEFAULT: C2RustUnnamed_34 = 1106193;
pub const KEYC_MOUSEDRAGEND2_STATUS_RIGHT: C2RustUnnamed_34 = 1106192;
pub const KEYC_MOUSEDRAGEND2_STATUS_LEFT: C2RustUnnamed_34 = 1106191;
pub const KEYC_MOUSEDRAGEND2_STATUS: C2RustUnnamed_34 = 1106190;
pub const KEYC_MOUSEDRAGEND2_PANE: C2RustUnnamed_34 = 1106189;
pub const KEYC_MOUSEDRAGEND1_BORDER: C2RustUnnamed_34 = 1106188;
pub const KEYC_MOUSEDRAGEND1_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106187;
pub const KEYC_MOUSEDRAGEND1_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106186;
pub const KEYC_MOUSEDRAGEND1_SCROLLBAR_UP: C2RustUnnamed_34 = 1106185;
pub const KEYC_MOUSEDRAGEND1_STATUS_DEFAULT: C2RustUnnamed_34 = 1106184;
pub const KEYC_MOUSEDRAGEND1_STATUS_RIGHT: C2RustUnnamed_34 = 1106183;
pub const KEYC_MOUSEDRAGEND1_STATUS_LEFT: C2RustUnnamed_34 = 1106182;
pub const KEYC_MOUSEDRAGEND1_STATUS: C2RustUnnamed_34 = 1106181;
pub const KEYC_MOUSEDRAGEND1_PANE: C2RustUnnamed_34 = 1106180;
pub const KEYC_MOUSEDRAG11_BORDER: C2RustUnnamed_34 = 1106179;
pub const KEYC_MOUSEDRAG11_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106178;
pub const KEYC_MOUSEDRAG11_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106177;
pub const KEYC_MOUSEDRAG11_SCROLLBAR_UP: C2RustUnnamed_34 = 1106176;
pub const KEYC_MOUSEDRAG11_STATUS_DEFAULT: C2RustUnnamed_34 = 1106175;
pub const KEYC_MOUSEDRAG11_STATUS_RIGHT: C2RustUnnamed_34 = 1106174;
pub const KEYC_MOUSEDRAG11_STATUS_LEFT: C2RustUnnamed_34 = 1106173;
pub const KEYC_MOUSEDRAG11_STATUS: C2RustUnnamed_34 = 1106172;
pub const KEYC_MOUSEDRAG11_PANE: C2RustUnnamed_34 = 1106171;
pub const KEYC_MOUSEDRAG10_BORDER: C2RustUnnamed_34 = 1106170;
pub const KEYC_MOUSEDRAG10_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106169;
pub const KEYC_MOUSEDRAG10_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106168;
pub const KEYC_MOUSEDRAG10_SCROLLBAR_UP: C2RustUnnamed_34 = 1106167;
pub const KEYC_MOUSEDRAG10_STATUS_DEFAULT: C2RustUnnamed_34 = 1106166;
pub const KEYC_MOUSEDRAG10_STATUS_RIGHT: C2RustUnnamed_34 = 1106165;
pub const KEYC_MOUSEDRAG10_STATUS_LEFT: C2RustUnnamed_34 = 1106164;
pub const KEYC_MOUSEDRAG10_STATUS: C2RustUnnamed_34 = 1106163;
pub const KEYC_MOUSEDRAG10_PANE: C2RustUnnamed_34 = 1106162;
pub const KEYC_MOUSEDRAG9_BORDER: C2RustUnnamed_34 = 1106161;
pub const KEYC_MOUSEDRAG9_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106160;
pub const KEYC_MOUSEDRAG9_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106159;
pub const KEYC_MOUSEDRAG9_SCROLLBAR_UP: C2RustUnnamed_34 = 1106158;
pub const KEYC_MOUSEDRAG9_STATUS_DEFAULT: C2RustUnnamed_34 = 1106157;
pub const KEYC_MOUSEDRAG9_STATUS_RIGHT: C2RustUnnamed_34 = 1106156;
pub const KEYC_MOUSEDRAG9_STATUS_LEFT: C2RustUnnamed_34 = 1106155;
pub const KEYC_MOUSEDRAG9_STATUS: C2RustUnnamed_34 = 1106154;
pub const KEYC_MOUSEDRAG9_PANE: C2RustUnnamed_34 = 1106153;
pub const KEYC_MOUSEDRAG8_BORDER: C2RustUnnamed_34 = 1106152;
pub const KEYC_MOUSEDRAG8_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106151;
pub const KEYC_MOUSEDRAG8_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106150;
pub const KEYC_MOUSEDRAG8_SCROLLBAR_UP: C2RustUnnamed_34 = 1106149;
pub const KEYC_MOUSEDRAG8_STATUS_DEFAULT: C2RustUnnamed_34 = 1106148;
pub const KEYC_MOUSEDRAG8_STATUS_RIGHT: C2RustUnnamed_34 = 1106147;
pub const KEYC_MOUSEDRAG8_STATUS_LEFT: C2RustUnnamed_34 = 1106146;
pub const KEYC_MOUSEDRAG8_STATUS: C2RustUnnamed_34 = 1106145;
pub const KEYC_MOUSEDRAG8_PANE: C2RustUnnamed_34 = 1106144;
pub const KEYC_MOUSEDRAG7_BORDER: C2RustUnnamed_34 = 1106143;
pub const KEYC_MOUSEDRAG7_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106142;
pub const KEYC_MOUSEDRAG7_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106141;
pub const KEYC_MOUSEDRAG7_SCROLLBAR_UP: C2RustUnnamed_34 = 1106140;
pub const KEYC_MOUSEDRAG7_STATUS_DEFAULT: C2RustUnnamed_34 = 1106139;
pub const KEYC_MOUSEDRAG7_STATUS_RIGHT: C2RustUnnamed_34 = 1106138;
pub const KEYC_MOUSEDRAG7_STATUS_LEFT: C2RustUnnamed_34 = 1106137;
pub const KEYC_MOUSEDRAG7_STATUS: C2RustUnnamed_34 = 1106136;
pub const KEYC_MOUSEDRAG7_PANE: C2RustUnnamed_34 = 1106135;
pub const KEYC_MOUSEDRAG6_BORDER: C2RustUnnamed_34 = 1106134;
pub const KEYC_MOUSEDRAG6_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106133;
pub const KEYC_MOUSEDRAG6_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106132;
pub const KEYC_MOUSEDRAG6_SCROLLBAR_UP: C2RustUnnamed_34 = 1106131;
pub const KEYC_MOUSEDRAG6_STATUS_DEFAULT: C2RustUnnamed_34 = 1106130;
pub const KEYC_MOUSEDRAG6_STATUS_RIGHT: C2RustUnnamed_34 = 1106129;
pub const KEYC_MOUSEDRAG6_STATUS_LEFT: C2RustUnnamed_34 = 1106128;
pub const KEYC_MOUSEDRAG6_STATUS: C2RustUnnamed_34 = 1106127;
pub const KEYC_MOUSEDRAG6_PANE: C2RustUnnamed_34 = 1106126;
pub const KEYC_MOUSEDRAG3_BORDER: C2RustUnnamed_34 = 1106125;
pub const KEYC_MOUSEDRAG3_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106124;
pub const KEYC_MOUSEDRAG3_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106123;
pub const KEYC_MOUSEDRAG3_SCROLLBAR_UP: C2RustUnnamed_34 = 1106122;
pub const KEYC_MOUSEDRAG3_STATUS_DEFAULT: C2RustUnnamed_34 = 1106121;
pub const KEYC_MOUSEDRAG3_STATUS_RIGHT: C2RustUnnamed_34 = 1106120;
pub const KEYC_MOUSEDRAG3_STATUS_LEFT: C2RustUnnamed_34 = 1106119;
pub const KEYC_MOUSEDRAG3_STATUS: C2RustUnnamed_34 = 1106118;
pub const KEYC_MOUSEDRAG3_PANE: C2RustUnnamed_34 = 1106117;
pub const KEYC_MOUSEDRAG2_BORDER: C2RustUnnamed_34 = 1106116;
pub const KEYC_MOUSEDRAG2_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106115;
pub const KEYC_MOUSEDRAG2_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106114;
pub const KEYC_MOUSEDRAG2_SCROLLBAR_UP: C2RustUnnamed_34 = 1106113;
pub const KEYC_MOUSEDRAG2_STATUS_DEFAULT: C2RustUnnamed_34 = 1106112;
pub const KEYC_MOUSEDRAG2_STATUS_RIGHT: C2RustUnnamed_34 = 1106111;
pub const KEYC_MOUSEDRAG2_STATUS_LEFT: C2RustUnnamed_34 = 1106110;
pub const KEYC_MOUSEDRAG2_STATUS: C2RustUnnamed_34 = 1106109;
pub const KEYC_MOUSEDRAG2_PANE: C2RustUnnamed_34 = 1106108;
pub const KEYC_MOUSEDRAG1_BORDER: C2RustUnnamed_34 = 1106107;
pub const KEYC_MOUSEDRAG1_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106106;
pub const KEYC_MOUSEDRAG1_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106105;
pub const KEYC_MOUSEDRAG1_SCROLLBAR_UP: C2RustUnnamed_34 = 1106104;
pub const KEYC_MOUSEDRAG1_STATUS_DEFAULT: C2RustUnnamed_34 = 1106103;
pub const KEYC_MOUSEDRAG1_STATUS_RIGHT: C2RustUnnamed_34 = 1106102;
pub const KEYC_MOUSEDRAG1_STATUS_LEFT: C2RustUnnamed_34 = 1106101;
pub const KEYC_MOUSEDRAG1_STATUS: C2RustUnnamed_34 = 1106100;
pub const KEYC_MOUSEDRAG1_PANE: C2RustUnnamed_34 = 1106099;
pub const KEYC_MOUSEUP11_BORDER: C2RustUnnamed_34 = 1106098;
pub const KEYC_MOUSEUP11_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106097;
pub const KEYC_MOUSEUP11_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106096;
pub const KEYC_MOUSEUP11_SCROLLBAR_UP: C2RustUnnamed_34 = 1106095;
pub const KEYC_MOUSEUP11_STATUS_DEFAULT: C2RustUnnamed_34 = 1106094;
pub const KEYC_MOUSEUP11_STATUS_RIGHT: C2RustUnnamed_34 = 1106093;
pub const KEYC_MOUSEUP11_STATUS_LEFT: C2RustUnnamed_34 = 1106092;
pub const KEYC_MOUSEUP11_STATUS: C2RustUnnamed_34 = 1106091;
pub const KEYC_MOUSEUP11_PANE: C2RustUnnamed_34 = 1106090;
pub const KEYC_MOUSEUP10_BORDER: C2RustUnnamed_34 = 1106089;
pub const KEYC_MOUSEUP10_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106088;
pub const KEYC_MOUSEUP10_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106087;
pub const KEYC_MOUSEUP10_SCROLLBAR_UP: C2RustUnnamed_34 = 1106086;
pub const KEYC_MOUSEUP10_STATUS_DEFAULT: C2RustUnnamed_34 = 1106085;
pub const KEYC_MOUSEUP10_STATUS_RIGHT: C2RustUnnamed_34 = 1106084;
pub const KEYC_MOUSEUP10_STATUS_LEFT: C2RustUnnamed_34 = 1106083;
pub const KEYC_MOUSEUP10_STATUS: C2RustUnnamed_34 = 1106082;
pub const KEYC_MOUSEUP10_PANE: C2RustUnnamed_34 = 1106081;
pub const KEYC_MOUSEUP9_BORDER: C2RustUnnamed_34 = 1106080;
pub const KEYC_MOUSEUP9_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106079;
pub const KEYC_MOUSEUP9_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106078;
pub const KEYC_MOUSEUP9_SCROLLBAR_UP: C2RustUnnamed_34 = 1106077;
pub const KEYC_MOUSEUP9_STATUS_DEFAULT: C2RustUnnamed_34 = 1106076;
pub const KEYC_MOUSEUP9_STATUS_RIGHT: C2RustUnnamed_34 = 1106075;
pub const KEYC_MOUSEUP9_STATUS_LEFT: C2RustUnnamed_34 = 1106074;
pub const KEYC_MOUSEUP9_STATUS: C2RustUnnamed_34 = 1106073;
pub const KEYC_MOUSEUP9_PANE: C2RustUnnamed_34 = 1106072;
pub const KEYC_MOUSEUP8_BORDER: C2RustUnnamed_34 = 1106071;
pub const KEYC_MOUSEUP8_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106070;
pub const KEYC_MOUSEUP8_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106069;
pub const KEYC_MOUSEUP8_SCROLLBAR_UP: C2RustUnnamed_34 = 1106068;
pub const KEYC_MOUSEUP8_STATUS_DEFAULT: C2RustUnnamed_34 = 1106067;
pub const KEYC_MOUSEUP8_STATUS_RIGHT: C2RustUnnamed_34 = 1106066;
pub const KEYC_MOUSEUP8_STATUS_LEFT: C2RustUnnamed_34 = 1106065;
pub const KEYC_MOUSEUP8_STATUS: C2RustUnnamed_34 = 1106064;
pub const KEYC_MOUSEUP8_PANE: C2RustUnnamed_34 = 1106063;
pub const KEYC_MOUSEUP7_BORDER: C2RustUnnamed_34 = 1106062;
pub const KEYC_MOUSEUP7_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106061;
pub const KEYC_MOUSEUP7_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106060;
pub const KEYC_MOUSEUP7_SCROLLBAR_UP: C2RustUnnamed_34 = 1106059;
pub const KEYC_MOUSEUP7_STATUS_DEFAULT: C2RustUnnamed_34 = 1106058;
pub const KEYC_MOUSEUP7_STATUS_RIGHT: C2RustUnnamed_34 = 1106057;
pub const KEYC_MOUSEUP7_STATUS_LEFT: C2RustUnnamed_34 = 1106056;
pub const KEYC_MOUSEUP7_STATUS: C2RustUnnamed_34 = 1106055;
pub const KEYC_MOUSEUP7_PANE: C2RustUnnamed_34 = 1106054;
pub const KEYC_MOUSEUP6_BORDER: C2RustUnnamed_34 = 1106053;
pub const KEYC_MOUSEUP6_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106052;
pub const KEYC_MOUSEUP6_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106051;
pub const KEYC_MOUSEUP6_SCROLLBAR_UP: C2RustUnnamed_34 = 1106050;
pub const KEYC_MOUSEUP6_STATUS_DEFAULT: C2RustUnnamed_34 = 1106049;
pub const KEYC_MOUSEUP6_STATUS_RIGHT: C2RustUnnamed_34 = 1106048;
pub const KEYC_MOUSEUP6_STATUS_LEFT: C2RustUnnamed_34 = 1106047;
pub const KEYC_MOUSEUP6_STATUS: C2RustUnnamed_34 = 1106046;
pub const KEYC_MOUSEUP6_PANE: C2RustUnnamed_34 = 1106045;
pub const KEYC_MOUSEUP3_BORDER: C2RustUnnamed_34 = 1106044;
pub const KEYC_MOUSEUP3_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106043;
pub const KEYC_MOUSEUP3_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106042;
pub const KEYC_MOUSEUP3_SCROLLBAR_UP: C2RustUnnamed_34 = 1106041;
pub const KEYC_MOUSEUP3_STATUS_DEFAULT: C2RustUnnamed_34 = 1106040;
pub const KEYC_MOUSEUP3_STATUS_RIGHT: C2RustUnnamed_34 = 1106039;
pub const KEYC_MOUSEUP3_STATUS_LEFT: C2RustUnnamed_34 = 1106038;
pub const KEYC_MOUSEUP3_STATUS: C2RustUnnamed_34 = 1106037;
pub const KEYC_MOUSEUP3_PANE: C2RustUnnamed_34 = 1106036;
pub const KEYC_MOUSEUP2_BORDER: C2RustUnnamed_34 = 1106035;
pub const KEYC_MOUSEUP2_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106034;
pub const KEYC_MOUSEUP2_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106033;
pub const KEYC_MOUSEUP2_SCROLLBAR_UP: C2RustUnnamed_34 = 1106032;
pub const KEYC_MOUSEUP2_STATUS_DEFAULT: C2RustUnnamed_34 = 1106031;
pub const KEYC_MOUSEUP2_STATUS_RIGHT: C2RustUnnamed_34 = 1106030;
pub const KEYC_MOUSEUP2_STATUS_LEFT: C2RustUnnamed_34 = 1106029;
pub const KEYC_MOUSEUP2_STATUS: C2RustUnnamed_34 = 1106028;
pub const KEYC_MOUSEUP2_PANE: C2RustUnnamed_34 = 1106027;
pub const KEYC_MOUSEUP1_BORDER: C2RustUnnamed_34 = 1106026;
pub const KEYC_MOUSEUP1_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106025;
pub const KEYC_MOUSEUP1_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106024;
pub const KEYC_MOUSEUP1_SCROLLBAR_UP: C2RustUnnamed_34 = 1106023;
pub const KEYC_MOUSEUP1_STATUS_DEFAULT: C2RustUnnamed_34 = 1106022;
pub const KEYC_MOUSEUP1_STATUS_RIGHT: C2RustUnnamed_34 = 1106021;
pub const KEYC_MOUSEUP1_STATUS_LEFT: C2RustUnnamed_34 = 1106020;
pub const KEYC_MOUSEUP1_STATUS: C2RustUnnamed_34 = 1106019;
pub const KEYC_MOUSEUP1_PANE: C2RustUnnamed_34 = 1106018;
pub const KEYC_MOUSEDOWN11_BORDER: C2RustUnnamed_34 = 1106017;
pub const KEYC_MOUSEDOWN11_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106016;
pub const KEYC_MOUSEDOWN11_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106015;
pub const KEYC_MOUSEDOWN11_SCROLLBAR_UP: C2RustUnnamed_34 = 1106014;
pub const KEYC_MOUSEDOWN11_STATUS_DEFAULT: C2RustUnnamed_34 = 1106013;
pub const KEYC_MOUSEDOWN11_STATUS_RIGHT: C2RustUnnamed_34 = 1106012;
pub const KEYC_MOUSEDOWN11_STATUS_LEFT: C2RustUnnamed_34 = 1106011;
pub const KEYC_MOUSEDOWN11_STATUS: C2RustUnnamed_34 = 1106010;
pub const KEYC_MOUSEDOWN11_PANE: C2RustUnnamed_34 = 1106009;
pub const KEYC_MOUSEDOWN10_BORDER: C2RustUnnamed_34 = 1106008;
pub const KEYC_MOUSEDOWN10_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1106007;
pub const KEYC_MOUSEDOWN10_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1106006;
pub const KEYC_MOUSEDOWN10_SCROLLBAR_UP: C2RustUnnamed_34 = 1106005;
pub const KEYC_MOUSEDOWN10_STATUS_DEFAULT: C2RustUnnamed_34 = 1106004;
pub const KEYC_MOUSEDOWN10_STATUS_RIGHT: C2RustUnnamed_34 = 1106003;
pub const KEYC_MOUSEDOWN10_STATUS_LEFT: C2RustUnnamed_34 = 1106002;
pub const KEYC_MOUSEDOWN10_STATUS: C2RustUnnamed_34 = 1106001;
pub const KEYC_MOUSEDOWN10_PANE: C2RustUnnamed_34 = 1106000;
pub const KEYC_MOUSEDOWN9_BORDER: C2RustUnnamed_34 = 1105999;
pub const KEYC_MOUSEDOWN9_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1105998;
pub const KEYC_MOUSEDOWN9_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1105997;
pub const KEYC_MOUSEDOWN9_SCROLLBAR_UP: C2RustUnnamed_34 = 1105996;
pub const KEYC_MOUSEDOWN9_STATUS_DEFAULT: C2RustUnnamed_34 = 1105995;
pub const KEYC_MOUSEDOWN9_STATUS_RIGHT: C2RustUnnamed_34 = 1105994;
pub const KEYC_MOUSEDOWN9_STATUS_LEFT: C2RustUnnamed_34 = 1105993;
pub const KEYC_MOUSEDOWN9_STATUS: C2RustUnnamed_34 = 1105992;
pub const KEYC_MOUSEDOWN9_PANE: C2RustUnnamed_34 = 1105991;
pub const KEYC_MOUSEDOWN8_BORDER: C2RustUnnamed_34 = 1105990;
pub const KEYC_MOUSEDOWN8_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1105989;
pub const KEYC_MOUSEDOWN8_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1105988;
pub const KEYC_MOUSEDOWN8_SCROLLBAR_UP: C2RustUnnamed_34 = 1105987;
pub const KEYC_MOUSEDOWN8_STATUS_DEFAULT: C2RustUnnamed_34 = 1105986;
pub const KEYC_MOUSEDOWN8_STATUS_RIGHT: C2RustUnnamed_34 = 1105985;
pub const KEYC_MOUSEDOWN8_STATUS_LEFT: C2RustUnnamed_34 = 1105984;
pub const KEYC_MOUSEDOWN8_STATUS: C2RustUnnamed_34 = 1105983;
pub const KEYC_MOUSEDOWN8_PANE: C2RustUnnamed_34 = 1105982;
pub const KEYC_MOUSEDOWN7_BORDER: C2RustUnnamed_34 = 1105981;
pub const KEYC_MOUSEDOWN7_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1105980;
pub const KEYC_MOUSEDOWN7_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1105979;
pub const KEYC_MOUSEDOWN7_SCROLLBAR_UP: C2RustUnnamed_34 = 1105978;
pub const KEYC_MOUSEDOWN7_STATUS_DEFAULT: C2RustUnnamed_34 = 1105977;
pub const KEYC_MOUSEDOWN7_STATUS_RIGHT: C2RustUnnamed_34 = 1105976;
pub const KEYC_MOUSEDOWN7_STATUS_LEFT: C2RustUnnamed_34 = 1105975;
pub const KEYC_MOUSEDOWN7_STATUS: C2RustUnnamed_34 = 1105974;
pub const KEYC_MOUSEDOWN7_PANE: C2RustUnnamed_34 = 1105973;
pub const KEYC_MOUSEDOWN6_BORDER: C2RustUnnamed_34 = 1105972;
pub const KEYC_MOUSEDOWN6_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1105971;
pub const KEYC_MOUSEDOWN6_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1105970;
pub const KEYC_MOUSEDOWN6_SCROLLBAR_UP: C2RustUnnamed_34 = 1105969;
pub const KEYC_MOUSEDOWN6_STATUS_DEFAULT: C2RustUnnamed_34 = 1105968;
pub const KEYC_MOUSEDOWN6_STATUS_RIGHT: C2RustUnnamed_34 = 1105967;
pub const KEYC_MOUSEDOWN6_STATUS_LEFT: C2RustUnnamed_34 = 1105966;
pub const KEYC_MOUSEDOWN6_STATUS: C2RustUnnamed_34 = 1105965;
pub const KEYC_MOUSEDOWN6_PANE: C2RustUnnamed_34 = 1105964;
pub const KEYC_MOUSEDOWN3_BORDER: C2RustUnnamed_34 = 1105963;
pub const KEYC_MOUSEDOWN3_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1105962;
pub const KEYC_MOUSEDOWN3_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1105961;
pub const KEYC_MOUSEDOWN3_SCROLLBAR_UP: C2RustUnnamed_34 = 1105960;
pub const KEYC_MOUSEDOWN3_STATUS_DEFAULT: C2RustUnnamed_34 = 1105959;
pub const KEYC_MOUSEDOWN3_STATUS_RIGHT: C2RustUnnamed_34 = 1105958;
pub const KEYC_MOUSEDOWN3_STATUS_LEFT: C2RustUnnamed_34 = 1105957;
pub const KEYC_MOUSEDOWN3_STATUS: C2RustUnnamed_34 = 1105956;
pub const KEYC_MOUSEDOWN3_PANE: C2RustUnnamed_34 = 1105955;
pub const KEYC_MOUSEDOWN2_BORDER: C2RustUnnamed_34 = 1105954;
pub const KEYC_MOUSEDOWN2_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1105953;
pub const KEYC_MOUSEDOWN2_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1105952;
pub const KEYC_MOUSEDOWN2_SCROLLBAR_UP: C2RustUnnamed_34 = 1105951;
pub const KEYC_MOUSEDOWN2_STATUS_DEFAULT: C2RustUnnamed_34 = 1105950;
pub const KEYC_MOUSEDOWN2_STATUS_RIGHT: C2RustUnnamed_34 = 1105949;
pub const KEYC_MOUSEDOWN2_STATUS_LEFT: C2RustUnnamed_34 = 1105948;
pub const KEYC_MOUSEDOWN2_STATUS: C2RustUnnamed_34 = 1105947;
pub const KEYC_MOUSEDOWN2_PANE: C2RustUnnamed_34 = 1105946;
pub const KEYC_MOUSEDOWN1_BORDER: C2RustUnnamed_34 = 1105945;
pub const KEYC_MOUSEDOWN1_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1105944;
pub const KEYC_MOUSEDOWN1_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1105943;
pub const KEYC_MOUSEDOWN1_SCROLLBAR_UP: C2RustUnnamed_34 = 1105942;
pub const KEYC_MOUSEDOWN1_STATUS_DEFAULT: C2RustUnnamed_34 = 1105941;
pub const KEYC_MOUSEDOWN1_STATUS_RIGHT: C2RustUnnamed_34 = 1105940;
pub const KEYC_MOUSEDOWN1_STATUS_LEFT: C2RustUnnamed_34 = 1105939;
pub const KEYC_MOUSEDOWN1_STATUS: C2RustUnnamed_34 = 1105938;
pub const KEYC_MOUSEDOWN1_PANE: C2RustUnnamed_34 = 1105937;
pub const KEYC_MOUSEMOVE_BORDER: C2RustUnnamed_34 = 1105936;
pub const KEYC_MOUSEMOVE_SCROLLBAR_DOWN: C2RustUnnamed_34 = 1105935;
pub const KEYC_MOUSEMOVE_SCROLLBAR_SLIDER: C2RustUnnamed_34 = 1105934;
pub const KEYC_MOUSEMOVE_SCROLLBAR_UP: C2RustUnnamed_34 = 1105933;
pub const KEYC_MOUSEMOVE_STATUS_DEFAULT: C2RustUnnamed_34 = 1105932;
pub const KEYC_MOUSEMOVE_STATUS_RIGHT: C2RustUnnamed_34 = 1105931;
pub const KEYC_MOUSEMOVE_STATUS_LEFT: C2RustUnnamed_34 = 1105930;
pub const KEYC_MOUSEMOVE_STATUS: C2RustUnnamed_34 = 1105929;
pub const KEYC_MOUSEMOVE_PANE: C2RustUnnamed_34 = 1105928;
pub const KEYC_DOUBLECLICK: C2RustUnnamed_34 = 1105927;
pub const KEYC_DRAGGING: C2RustUnnamed_34 = 1105926;
pub const KEYC_MOUSE: C2RustUnnamed_34 = 1105925;
pub const KEYC_PASTE_END: C2RustUnnamed_34 = 1105924;
pub const KEYC_PASTE_START: C2RustUnnamed_34 = 1105923;
pub const KEYC_ANY: C2RustUnnamed_34 = 1105922;
pub const KEYC_FOCUS_OUT: C2RustUnnamed_34 = 1105921;
pub const KEYC_FOCUS_IN: C2RustUnnamed_34 = 1105920;
pub type box_lines = libc::c_int;
pub const BOX_LINES_NONE: box_lines = 6;
pub const BOX_LINES_PADDED: box_lines = 5;
pub const BOX_LINES_ROUNDED: box_lines = 4;
pub const BOX_LINES_SIMPLE: box_lines = 3;
pub const BOX_LINES_HEAVY: box_lines = 2;
pub const BOX_LINES_DOUBLE: box_lines = 1;
pub const BOX_LINES_SINGLE: box_lines = 0;
pub const BOX_LINES_DEFAULT: box_lines = -1;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct menu_item {
    pub name: *const libc::c_char,
    pub key: key_code,
    pub command: *const libc::c_char,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct menu {
    pub title: *const libc::c_char,
    pub items: *mut menu_item,
    pub count: u_int,
    pub width: u_int,
}
pub type menu_choice_cb =
    Option<unsafe extern "C" fn(*mut menu, u_int, key_code, *mut libc::c_void) -> ()>;
pub type job_update_cb = Option<unsafe extern "C" fn(*mut job) -> ()>;
pub type job_complete_cb = Option<unsafe extern "C" fn(*mut job) -> ()>;
pub type job_free_cb = Option<unsafe extern "C" fn(*mut libc::c_void) -> ()>;
pub type popup_close_cb = Option<unsafe extern "C" fn(libc::c_int, *mut libc::c_void) -> ()>;
pub type popup_finish_edit_cb =
    Option<unsafe extern "C" fn(*mut libc::c_char, size_t, *mut libc::c_void) -> ()>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct popup_data {
    pub c: *mut client,
    pub item: *mut cmdq_item,
    pub flags: libc::c_int,
    pub title: *mut libc::c_char,
    pub border_cell: grid_cell,
    pub border_lines: box_lines,
    pub s: screen,
    pub defaults: grid_cell,
    pub palette: colour_palette,
    pub job: *mut job,
    pub ictx: *mut input_ctx,
    pub status: libc::c_int,
    pub cb: popup_close_cb,
    pub arg: *mut libc::c_void,
    pub menu: *mut menu,
    pub md: *mut menu_data,
    pub close: libc::c_int,
    pub px: u_int,
    pub py: u_int,
    pub sx: u_int,
    pub sy: u_int,
    pub ppx: u_int,
    pub ppy: u_int,
    pub psx: u_int,
    pub psy: u_int,
    pub dragging: C2RustUnnamed_35,
    pub dx: u_int,
    pub dy: u_int,
    pub lx: u_int,
    pub ly: u_int,
    pub lb: u_int,
}
pub type C2RustUnnamed_35 = libc::c_uint;
pub const SIZE: C2RustUnnamed_35 = 2;
pub const MOVE: C2RustUnnamed_35 = 1;
pub const OFF: C2RustUnnamed_35 = 0;
pub const NONE: C2RustUnnamed_36 = 0;
pub type C2RustUnnamed_36 = libc::c_uint;
pub const BOTTOM: C2RustUnnamed_36 = 4;
pub const TOP: C2RustUnnamed_36 = 3;
pub const RIGHT: C2RustUnnamed_36 = 2;
pub const LEFT: C2RustUnnamed_36 = 1;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct popup_editor {
    pub path: *mut libc::c_char,
    pub cb: popup_finish_edit_cb,
    pub arg: *mut libc::c_void,
}
static mut popup_menu_items: [menu_item; 9] = [
    {
        let mut init = menu_item {
            name: b"Close\0" as *const u8 as *const libc::c_char,
            key: 'q' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"#{?buffer_name,Paste #[underscore]#{buffer_name},}\0" as *const u8
                as *const libc::c_char,
            key: 'p' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"\0" as *const u8 as *const libc::c_char,
            key: 0xff000000000 as libc::c_ulonglong,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"Fill Space\0" as *const u8 as *const libc::c_char,
            key: 'F' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"Centre\0" as *const u8 as *const libc::c_char,
            key: 'C' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"\0" as *const u8 as *const libc::c_char,
            key: 0xff000000000 as libc::c_ulonglong,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"To Horizontal Pane\0" as *const u8 as *const libc::c_char,
            key: 'h' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"To Vertical Pane\0" as *const u8 as *const libc::c_char,
            key: 'v' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: 0 as *const libc::c_char,
            key: 0xff000000000 as libc::c_ulonglong,
            command: 0 as *const libc::c_char,
        };
        init
    },
];
static mut popup_internal_menu_items: [menu_item; 5] = [
    {
        let mut init = menu_item {
            name: b"Close\0" as *const u8 as *const libc::c_char,
            key: 'q' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"\0" as *const u8 as *const libc::c_char,
            key: 0xff000000000 as libc::c_ulonglong,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"Fill Space\0" as *const u8 as *const libc::c_char,
            key: 'F' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: b"Centre\0" as *const u8 as *const libc::c_char,
            key: 'C' as i32 as key_code,
            command: 0 as *const libc::c_char,
        };
        init
    },
    {
        let mut init = menu_item {
            name: 0 as *const libc::c_char,
            key: 0xff000000000 as libc::c_ulonglong,
            command: 0 as *const libc::c_char,
        };
        init
    },
];
unsafe extern "C" fn popup_redraw_cb(mut ttyctx: *const tty_ctx) {
    let mut pd: *mut popup_data = (*ttyctx).arg as *mut popup_data;
    (*(*pd).c).flags |= 0x2000000 as libc::c_int as libc::c_ulong;
}
unsafe extern "C" fn popup_set_client_cb(
    mut ttyctx: *mut tty_ctx,
    mut c: *mut client,
) -> libc::c_int {
    let mut pd: *mut popup_data = (*ttyctx).arg as *mut popup_data;
    if c != (*pd).c {
        return 0 as libc::c_int;
    }
    if (*(*pd).c).flags & 0x2000000 as libc::c_int as libc::c_ulong != 0 {
        return 0 as libc::c_int;
    }
    (*ttyctx).bigger = 0 as libc::c_int;
    (*ttyctx).wox = 0 as libc::c_int as u_int;
    (*ttyctx).woy = 0 as libc::c_int as u_int;
    (*ttyctx).wsx = (*c).tty.sx;
    (*ttyctx).wsy = (*c).tty.sy;
    if (*pd).border_lines as libc::c_int == BOX_LINES_NONE as libc::c_int {
        (*ttyctx).rxoff = (*pd).px;
        (*ttyctx).xoff = (*ttyctx).rxoff;
        (*ttyctx).ryoff = (*pd).py;
        (*ttyctx).yoff = (*ttyctx).ryoff;
    } else {
        (*ttyctx).rxoff = ((*pd).px).wrapping_add(1 as libc::c_int as libc::c_uint);
        (*ttyctx).xoff = (*ttyctx).rxoff;
        (*ttyctx).ryoff = ((*pd).py).wrapping_add(1 as libc::c_int as libc::c_uint);
        (*ttyctx).yoff = (*ttyctx).ryoff;
    }
    return 1 as libc::c_int;
}
unsafe extern "C" fn popup_init_ctx_cb(mut ctx: *mut screen_write_ctx, mut ttyctx: *mut tty_ctx) {
    let mut pd: *mut popup_data = (*ctx).arg as *mut popup_data;
    memcpy(
        &mut (*ttyctx).defaults as *mut grid_cell as *mut libc::c_void,
        &mut (*pd).defaults as *mut grid_cell as *const libc::c_void,
        ::core::mem::size_of::<grid_cell>() as libc::c_ulong,
    );
    (*ttyctx).palette = &mut (*pd).palette;
    (*ttyctx).redraw_cb = Some(popup_redraw_cb as unsafe extern "C" fn(*const tty_ctx) -> ());
    (*ttyctx).set_client_cb =
        Some(popup_set_client_cb as unsafe extern "C" fn(*mut tty_ctx, *mut client) -> libc::c_int);
    (*ttyctx).arg = pd as *mut libc::c_void;
}
unsafe extern "C" fn popup_mode_cb(
    mut c: *mut client,
    mut data: *mut libc::c_void,
    mut cx: *mut u_int,
    mut cy: *mut u_int,
) -> *mut screen {
    let mut pd: *mut popup_data = data as *mut popup_data;
    if !((*pd).md).is_null() {
        return menu_mode_cb(c, (*pd).md as *mut libc::c_void, cx, cy);
    }
    if (*pd).border_lines as libc::c_int == BOX_LINES_NONE as libc::c_int {
        *cx = ((*pd).px).wrapping_add((*pd).s.cx);
        *cy = ((*pd).py).wrapping_add((*pd).s.cy);
    } else {
        *cx = ((*pd).px)
            .wrapping_add(1 as libc::c_int as libc::c_uint)
            .wrapping_add((*pd).s.cx);
        *cy = ((*pd).py)
            .wrapping_add(1 as libc::c_int as libc::c_uint)
            .wrapping_add((*pd).s.cy);
    }
    return &mut (*pd).s;
}
unsafe extern "C" fn popup_check_cb(
    mut c: *mut client,
    mut data: *mut libc::c_void,
    mut px: u_int,
    mut py: u_int,
    mut nx: u_int,
    mut r: *mut overlay_ranges,
) {
    let mut pd: *mut popup_data = data as *mut popup_data;
    let mut or: [overlay_ranges; 2] = [overlay_ranges {
        px: [0; 3],
        nx: [0; 3],
    }; 2];
    let mut i: u_int = 0;
    let mut j: u_int = 0;
    let mut k: u_int = 0 as libc::c_int as u_int;
    if !((*pd).md).is_null() {
        menu_check_cb(c, (*pd).md as *mut libc::c_void, px, py, nx, r);
        i = 0 as libc::c_int as u_int;
        while i < 2 as libc::c_int as libc::c_uint {
            server_client_overlay_range(
                (*pd).px,
                (*pd).py,
                (*pd).sx,
                (*pd).sy,
                (*r).px[i as usize],
                py,
                (*r).nx[i as usize],
                &mut *or.as_mut_ptr().offset(i as isize),
            );
            i = i.wrapping_add(1);
        }
        i = 0 as libc::c_int as u_int;
        while i < 2 as libc::c_int as libc::c_uint {
            j = 0 as libc::c_int as u_int;
            while j < 2 as libc::c_int as libc::c_uint {
                if or[i as usize].nx[j as usize] > 0 as libc::c_int as libc::c_uint {
                    (*r).px[k as usize] = or[i as usize].px[j as usize];
                    (*r).nx[k as usize] = or[i as usize].nx[j as usize];
                    k = k.wrapping_add(1);
                }
                j = j.wrapping_add(1);
            }
            i = i.wrapping_add(1);
        }
        i = k;
        while i < 3 as libc::c_int as libc::c_uint {
            (*r).px[i as usize] = 0 as libc::c_int as u_int;
            (*r).nx[i as usize] = 0 as libc::c_int as u_int;
            i = i.wrapping_add(1);
        }
        return;
    }
    server_client_overlay_range((*pd).px, (*pd).py, (*pd).sx, (*pd).sy, px, py, nx, r);
}
unsafe extern "C" fn popup_draw_cb(
    mut c: *mut client,
    mut data: *mut libc::c_void,
    mut rctx: *mut screen_redraw_ctx,
) {
    let mut pd: *mut popup_data = data as *mut popup_data;
    let mut tty: *mut tty = &mut (*c).tty;
    let mut s: screen = screen {
        title: std::ptr::null_mut::<libc::c_char>(),
        path: std::ptr::null_mut::<libc::c_char>(),
        titles: std::ptr::null_mut::<screen_titles>(),
        grid: std::ptr::null_mut::<grid>(),
        cx: 0,
        cy: 0,
        cstyle: SCREEN_CURSOR_DEFAULT,
        default_cstyle: SCREEN_CURSOR_DEFAULT,
        ccolour: 0,
        default_ccolour: 0,
        rupper: 0,
        rlower: 0,
        mode: 0,
        default_mode: 0,
        saved_cx: 0,
        saved_cy: 0,
        saved_grid: std::ptr::null_mut::<grid>(),
        saved_cell: grid_cell {
            data: utf8_data {
                data: [0; 21],
                have: 0,
                size: 0,
                width: 0,
            },
            attr: 0,
            flags: 0,
            fg: 0,
            bg: 0,
            us: 0,
            link: 0,
        },
        saved_flags: 0,
        tabs: std::ptr::null_mut::<bitstr_t>(),
        sel: std::ptr::null_mut::<screen_sel>(),
        write_list: std::ptr::null_mut::<screen_write_cline>(),
        hyperlinks: std::ptr::null_mut::<hyperlinks>(),
    };
    let mut ctx: screen_write_ctx = screen_write_ctx {
        wp: std::ptr::null_mut::<window_pane>(),
        s: std::ptr::null_mut::<screen>(),
        flags: 0,
        init_ctx_cb: None,
        arg: std::ptr::null_mut::<libc::c_void>(),
        item: std::ptr::null_mut::<screen_write_citem>(),
        scrolled: 0,
        bg: 0,
    };
    let mut i: u_int = 0;
    let mut px: u_int = (*pd).px;
    let mut py: u_int = (*pd).py;
    let mut palette: *mut colour_palette = &mut (*pd).palette;
    let mut defaults: grid_cell = grid_cell {
        data: utf8_data {
            data: [0; 21],
            have: 0,
            size: 0,
            width: 0,
        },
        attr: 0,
        flags: 0,
        fg: 0,
        bg: 0,
        us: 0,
        link: 0,
    };
    screen_init(&mut s, (*pd).sx, (*pd).sy, 0 as libc::c_int as u_int);
    screen_write_start(&mut ctx, &mut s);
    screen_write_clearscreen(&mut ctx, 8 as libc::c_int as u_int);
    if (*pd).border_lines as libc::c_int == BOX_LINES_NONE as libc::c_int {
        screen_write_cursormove(
            &mut ctx,
            0 as libc::c_int,
            0 as libc::c_int,
            0 as libc::c_int,
        );
        screen_write_fast_copy(
            &mut ctx,
            &mut (*pd).s,
            0 as libc::c_int as u_int,
            0 as libc::c_int as u_int,
            (*pd).sx,
            (*pd).sy,
        );
    } else if (*pd).sx > 2 as libc::c_int as libc::c_uint
        && (*pd).sy > 2 as libc::c_int as libc::c_uint
    {
        screen_write_box(
            &mut ctx,
            (*pd).sx,
            (*pd).sy,
            (*pd).border_lines,
            &mut (*pd).border_cell,
            (*pd).title,
        );
        screen_write_cursormove(
            &mut ctx,
            1 as libc::c_int,
            1 as libc::c_int,
            0 as libc::c_int,
        );
        screen_write_fast_copy(
            &mut ctx,
            &mut (*pd).s,
            0 as libc::c_int as u_int,
            0 as libc::c_int as u_int,
            ((*pd).sx).wrapping_sub(2 as libc::c_int as libc::c_uint),
            ((*pd).sy).wrapping_sub(2 as libc::c_int as libc::c_uint),
        );
    }
    screen_write_stop(&mut ctx);
    memcpy(
        &mut defaults as *mut grid_cell as *mut libc::c_void,
        &mut (*pd).defaults as *mut grid_cell as *const libc::c_void,
        ::core::mem::size_of::<grid_cell>() as libc::c_ulong,
    );
    if defaults.fg == 8 as libc::c_int {
        defaults.fg = (*palette).fg;
    }
    if defaults.bg == 8 as libc::c_int {
        defaults.bg = (*palette).bg;
    }
    if !((*pd).md).is_null() {
        (*c).overlay_check = Some(
            menu_check_cb
                as unsafe extern "C" fn(
                    *mut client,
                    *mut libc::c_void,
                    u_int,
                    u_int,
                    u_int,
                    *mut overlay_ranges,
                ) -> (),
        );
        (*c).overlay_data = (*pd).md as *mut libc::c_void;
    } else {
        (*c).overlay_check = None;
        (*c).overlay_data = std::ptr::null_mut::<libc::c_void>();
    }
    i = 0 as libc::c_int as u_int;
    while i < (*pd).sy {
        tty_draw_line(
            tty,
            &mut s,
            0 as libc::c_int as u_int,
            i,
            (*pd).sx,
            px,
            py.wrapping_add(i),
            &mut defaults,
            palette,
        );
        i = i.wrapping_add(1);
    }
    screen_free(&mut s);
    if !((*pd).md).is_null() {
        (*c).overlay_check = None;
        (*c).overlay_data = std::ptr::null_mut::<libc::c_void>();
        menu_draw_cb(c, (*pd).md as *mut libc::c_void, rctx);
    }
    (*c).overlay_check = Some(
        popup_check_cb
            as unsafe extern "C" fn(
                *mut client,
                *mut libc::c_void,
                u_int,
                u_int,
                u_int,
                *mut overlay_ranges,
            ) -> (),
    );
    (*c).overlay_data = pd as *mut libc::c_void;
}
unsafe extern "C" fn popup_free_cb(mut c: *mut client, mut data: *mut libc::c_void) {
    let mut pd: *mut popup_data = data as *mut popup_data;
    let mut item: *mut cmdq_item = (*pd).item;
    if !((*pd).md).is_null() {
        menu_free_cb(c, (*pd).md as *mut libc::c_void);
    }
    if ((*pd).cb).is_some() {
        ((*pd).cb).expect("non-null function pointer")((*pd).status, (*pd).arg);
    }
    if !item.is_null() {
        if !(cmdq_get_client(item)).is_null() && ((*cmdq_get_client(item)).session).is_null() {
            (*cmdq_get_client(item)).retval = (*pd).status;
        }
        cmdq_continue(item);
    }
    server_client_unref((*pd).c);
    if !((*pd).job).is_null() {
        job_free((*pd).job);
    }
    input_free((*pd).ictx);
    screen_free(&mut (*pd).s);
    colour_palette_free(&mut (*pd).palette);
    free((*pd).title as *mut libc::c_void);
    free(pd as *mut libc::c_void);
}
unsafe extern "C" fn popup_resize_cb(mut c: *mut client, mut data: *mut libc::c_void) {
    let mut pd: *mut popup_data = data as *mut popup_data;
    let mut tty: *mut tty = &mut (*c).tty;
    if pd.is_null() {
        return;
    }
    if !((*pd).md).is_null() {
        menu_free_cb(c, (*pd).md as *mut libc::c_void);
    }
    if (*pd).psy > (*tty).sy {
        (*pd).sy = (*tty).sy;
    } else {
        (*pd).sy = (*pd).psy;
    }
    if (*pd).psx > (*tty).sx {
        (*pd).sx = (*tty).sx;
    } else {
        (*pd).sx = (*pd).psx;
    }
    if ((*pd).ppy).wrapping_add((*pd).sy) > (*tty).sy {
        (*pd).py = ((*tty).sy).wrapping_sub((*pd).sy);
    } else {
        (*pd).py = (*pd).ppy;
    }
    if ((*pd).ppx).wrapping_add((*pd).sx) > (*tty).sx {
        (*pd).px = ((*tty).sx).wrapping_sub((*pd).sx);
    } else {
        (*pd).px = (*pd).ppx;
    }
    if (*pd).border_lines as libc::c_int == BOX_LINES_NONE as libc::c_int {
        screen_resize(&mut (*pd).s, (*pd).sx, (*pd).sy, 0 as libc::c_int);
        if !((*pd).job).is_null() {
            job_resize((*pd).job, (*pd).sx, (*pd).sy);
        }
    } else if (*pd).sx > 2 as libc::c_int as libc::c_uint
        && (*pd).sy > 2 as libc::c_int as libc::c_uint
    {
        screen_resize(
            &mut (*pd).s,
            ((*pd).sx).wrapping_sub(2 as libc::c_int as libc::c_uint),
            ((*pd).sy).wrapping_sub(2 as libc::c_int as libc::c_uint),
            0 as libc::c_int,
        );
        if !((*pd).job).is_null() {
            job_resize(
                (*pd).job,
                ((*pd).sx).wrapping_sub(2 as libc::c_int as libc::c_uint),
                ((*pd).sy).wrapping_sub(2 as libc::c_int as libc::c_uint),
            );
        }
    }
}
unsafe extern "C" fn popup_make_pane(mut pd: *mut popup_data, mut type_0: layout_type) {
    let mut c: *mut client = (*pd).c;
    let mut s: *mut session = (*c).session;
    let mut w: *mut window = (*(*s).curw).window;
    let mut lc: *mut layout_cell = std::ptr::null_mut::<layout_cell>();
    let mut wp: *mut window_pane = (*w).active;
    let mut new_wp: *mut window_pane = std::ptr::null_mut::<window_pane>();
    let mut hlimit: u_int = 0;
    let mut shell: *const libc::c_char = std::ptr::null::<libc::c_char>();
    window_unzoom(w, 1 as libc::c_int);
    lc = layout_split_pane(wp, type_0, -(1 as libc::c_int), 0 as libc::c_int);
    hlimit = options_get_number(
        (*s).options,
        b"history-limit\0" as *const u8 as *const libc::c_char,
    ) as u_int;
    new_wp = window_add_pane(
        (*wp).window,
        std::ptr::null_mut::<window_pane>(),
        hlimit,
        0 as libc::c_int,
    );
    layout_assign_pane(lc, new_wp, 0 as libc::c_int);
    (*new_wp).fd = job_transfer(
        (*pd).job,
        &mut (*new_wp).pid,
        ((*new_wp).tty).as_mut_ptr(),
        ::core::mem::size_of::<[libc::c_char; 32]>() as libc::c_ulong,
    );
    (*pd).job = std::ptr::null_mut::<job>();
    screen_set_title(&mut (*pd).s, (*new_wp).base.title);
    screen_free(&mut (*new_wp).base);
    memcpy(
        &mut (*new_wp).base as *mut screen as *mut libc::c_void,
        &mut (*pd).s as *mut screen as *const libc::c_void,
        ::core::mem::size_of::<screen>() as libc::c_ulong,
    );
    screen_resize(
        &mut (*new_wp).base,
        (*new_wp).sx,
        (*new_wp).sy,
        1 as libc::c_int,
    );
    screen_init(
        &mut (*pd).s,
        1 as libc::c_int as u_int,
        1 as libc::c_int as u_int,
        0 as libc::c_int as u_int,
    );
    shell = options_get_string(
        (*s).options,
        b"default-shell\0" as *const u8 as *const libc::c_char,
    );
    if checkshell(shell) == 0 {
        shell = b"/bin/sh\0" as *const u8 as *const libc::c_char;
    }
    (*new_wp).shell = xstrdup(shell);
    window_pane_set_event(new_wp);
    window_set_active_pane(w, new_wp, 1 as libc::c_int);
    (*new_wp).flags |= 0x80 as libc::c_int;
    (*pd).close = 1 as libc::c_int;
}
unsafe extern "C" fn popup_menu_done(
    mut menu: *mut menu,
    mut choice: u_int,
    mut key: key_code,
    mut data: *mut libc::c_void,
) {
    let mut pd: *mut popup_data = data as *mut popup_data;
    let mut c: *mut client = (*pd).c;
    let mut pb: *mut paste_buffer = std::ptr::null_mut::<paste_buffer>();
    let mut buf: *const libc::c_char = std::ptr::null::<libc::c_char>();
    let mut len: size_t = 0;
    (*pd).md = std::ptr::null_mut::<menu_data>();
    (*pd).menu = std::ptr::null_mut::<menu>();
    server_redraw_client((*pd).c);
    match key {
        112 => {
            pb = paste_get_top(std::ptr::null_mut::<*const libc::c_char>());
            if !pb.is_null() {
                buf = paste_buffer_data(pb, &mut len);
                bufferevent_write(job_get_event((*pd).job), buf as *const libc::c_void, len);
            }
        }
        70 => {
            (*pd).sx = (*c).tty.sx;
            (*pd).sy = (*c).tty.sy;
            (*pd).px = 0 as libc::c_int as u_int;
            (*pd).py = 0 as libc::c_int as u_int;
            server_redraw_client(c);
        }
        67 => {
            (*pd).px = ((*c).tty.sx)
                .wrapping_div(2 as libc::c_int as libc::c_uint)
                .wrapping_sub(((*pd).sx).wrapping_div(2 as libc::c_int as libc::c_uint));
            (*pd).py = ((*c).tty.sy)
                .wrapping_div(2 as libc::c_int as libc::c_uint)
                .wrapping_sub(((*pd).sy).wrapping_div(2 as libc::c_int as libc::c_uint));
            server_redraw_client(c);
        }
        104 => {
            popup_make_pane(pd, LAYOUT_LEFTRIGHT);
        }
        118 => {
            popup_make_pane(pd, LAYOUT_TOPBOTTOM);
        }
        113 => {
            (*pd).close = 1 as libc::c_int;
        }
        _ => {}
    };
}
unsafe extern "C" fn popup_handle_drag(
    mut c: *mut client,
    mut pd: *mut popup_data,
    mut m: *mut mouse_event,
) {
    let mut px: u_int = 0;
    let mut py: u_int = 0;
    if (*m).b & 32 as libc::c_int as libc::c_uint == 0 {
        (*pd).dragging = OFF;
    } else if (*pd).dragging as libc::c_uint == MOVE as libc::c_int as libc::c_uint {
        if (*m).x < (*pd).dx {
            px = 0 as libc::c_int as u_int;
        } else if ((*m).x).wrapping_sub((*pd).dx).wrapping_add((*pd).sx) > (*c).tty.sx {
            px = ((*c).tty.sx).wrapping_sub((*pd).sx);
        } else {
            px = ((*m).x).wrapping_sub((*pd).dx);
        }
        if (*m).y < (*pd).dy {
            py = 0 as libc::c_int as u_int;
        } else if ((*m).y).wrapping_sub((*pd).dy).wrapping_add((*pd).sy) > (*c).tty.sy {
            py = ((*c).tty.sy).wrapping_sub((*pd).sy);
        } else {
            py = ((*m).y).wrapping_sub((*pd).dy);
        }
        (*pd).px = px;
        (*pd).py = py;
        (*pd).dx = ((*m).x).wrapping_sub((*pd).px);
        (*pd).dy = ((*m).y).wrapping_sub((*pd).py);
        (*pd).ppx = px;
        (*pd).ppy = py;
        server_redraw_client(c);
    } else if (*pd).dragging as libc::c_uint == SIZE as libc::c_int as libc::c_uint {
        if (*pd).border_lines as libc::c_int == BOX_LINES_NONE as libc::c_int {
            if (*m).x < ((*pd).px).wrapping_add(1 as libc::c_int as libc::c_uint) {
                return;
            }
            if (*m).y < ((*pd).py).wrapping_add(1 as libc::c_int as libc::c_uint) {
                return;
            }
        } else {
            if (*m).x < ((*pd).px).wrapping_add(3 as libc::c_int as libc::c_uint) {
                return;
            }
            if (*m).y < ((*pd).py).wrapping_add(3 as libc::c_int as libc::c_uint) {
                return;
            }
        }
        (*pd).sx = ((*m).x).wrapping_sub((*pd).px);
        (*pd).sy = ((*m).y).wrapping_sub((*pd).py);
        (*pd).psx = (*pd).sx;
        (*pd).psy = (*pd).sy;
        if (*pd).border_lines as libc::c_int == BOX_LINES_NONE as libc::c_int {
            screen_resize(&mut (*pd).s, (*pd).sx, (*pd).sy, 0 as libc::c_int);
            if !((*pd).job).is_null() {
                job_resize((*pd).job, (*pd).sx, (*pd).sy);
            }
        } else {
            screen_resize(
                &mut (*pd).s,
                ((*pd).sx).wrapping_sub(2 as libc::c_int as libc::c_uint),
                ((*pd).sy).wrapping_sub(2 as libc::c_int as libc::c_uint),
                0 as libc::c_int,
            );
            if !((*pd).job).is_null() {
                job_resize(
                    (*pd).job,
                    ((*pd).sx).wrapping_sub(2 as libc::c_int as libc::c_uint),
                    ((*pd).sy).wrapping_sub(2 as libc::c_int as libc::c_uint),
                );
            }
        }
        server_redraw_client(c);
    }
}
unsafe extern "C" fn popup_key_cb(
    mut c: *mut client,
    mut data: *mut libc::c_void,
    mut event: *mut key_event,
) -> libc::c_int {
    let mut current_block: u64;
    let mut pd: *mut popup_data = data as *mut popup_data;
    let mut m: *mut mouse_event = &mut (*event).m;
    let mut buf: *const libc::c_char = std::ptr::null::<libc::c_char>();
    let mut len: size_t = 0;
    let mut px: u_int = 0;
    let mut py: u_int = 0;
    let mut x: u_int = 0;
    let mut border: C2RustUnnamed_36 = NONE;
    if !((*pd).md).is_null() {
        if menu_key_cb(c, (*pd).md as *mut libc::c_void, event) == 1 as libc::c_int {
            (*pd).md = std::ptr::null_mut::<menu_data>();
            (*pd).menu = std::ptr::null_mut::<menu>();
            if (*pd).close != 0 {
                server_client_clear_overlay(c);
            } else {
                server_redraw_client(c);
            }
        }
        return 0 as libc::c_int;
    }
    if (*event).key & 0xfffffffffff as libc::c_ulonglong
        >= KEYC_MOUSE as libc::c_int as libc::c_ulonglong
        && ((*event).key & 0xfffffffffff as libc::c_ulonglong)
            < KEYC_BSPACE as libc::c_int as libc::c_ulonglong
    {
        if (*pd).dragging as libc::c_uint != OFF as libc::c_int as libc::c_uint {
            popup_handle_drag(c, pd, m);
            current_block = 9508674642284537134;
        } else {
            if (*m).x < (*pd).px
                || (*m).x
                    > ((*pd).px)
                        .wrapping_add((*pd).sx)
                        .wrapping_sub(1 as libc::c_int as libc::c_uint)
                || (*m).y < (*pd).py
                || (*m).y
                    > ((*pd).py)
                        .wrapping_add((*pd).sy)
                        .wrapping_sub(1 as libc::c_int as libc::c_uint)
            {
                if (*m).b & 195 as libc::c_int as libc::c_uint == 2 as libc::c_int as libc::c_uint {
                    current_block = 1023363059494762800;
                } else {
                    return 0 as libc::c_int;
                }
            } else {
                if (*pd).border_lines as libc::c_int != BOX_LINES_NONE as libc::c_int {
                    if (*m).x == (*pd).px {
                        border = LEFT;
                    } else if (*m).x
                        == ((*pd).px)
                            .wrapping_add((*pd).sx)
                            .wrapping_sub(1 as libc::c_int as libc::c_uint)
                    {
                        border = RIGHT;
                    } else if (*m).y == (*pd).py {
                        border = TOP;
                    } else if (*m).y
                        == ((*pd).py)
                            .wrapping_add((*pd).sy)
                            .wrapping_sub(1 as libc::c_int as libc::c_uint)
                    {
                        border = BOTTOM;
                    }
                }
                if (*m).b
                    & (4 as libc::c_int | 8 as libc::c_int | 16 as libc::c_int) as libc::c_uint
                    == 0 as libc::c_int as libc::c_uint
                    && (*m).b & 195 as libc::c_int as libc::c_uint
                        == 2 as libc::c_int as libc::c_uint
                    && (border as libc::c_uint == LEFT as libc::c_int as libc::c_uint
                        || border as libc::c_uint == TOP as libc::c_int as libc::c_uint)
                {
                    current_block = 1023363059494762800;
                } else if (*m).b
                    & (4 as libc::c_int | 8 as libc::c_int | 16 as libc::c_int) as libc::c_uint
                    == 8 as libc::c_int as libc::c_uint
                    || border as libc::c_uint != NONE as libc::c_int as libc::c_uint
                {
                    if (*m).b & 32 as libc::c_int as libc::c_uint == 0 {
                        current_block = 9508674642284537134;
                    } else {
                        if (*m).lb & 195 as libc::c_int as libc::c_uint
                            == 0 as libc::c_int as libc::c_uint
                        {
                            (*pd).dragging = MOVE;
                        } else if (*m).lb & 195 as libc::c_int as libc::c_uint
                            == 2 as libc::c_int as libc::c_uint
                        {
                            (*pd).dragging = SIZE;
                        }
                        (*pd).dx = ((*m).lx).wrapping_sub((*pd).px);
                        (*pd).dy = ((*m).ly).wrapping_sub((*pd).py);
                        current_block = 9508674642284537134;
                    }
                } else {
                    current_block = 3275366147856559585;
                }
            }
            match current_block {
                9508674642284537134 => {}
                3275366147856559585 => {}
                _ => {
                    (*pd).menu = menu_create(b"\0" as *const u8 as *const libc::c_char);
                    if (*pd).flags & 0x4 as libc::c_int != 0 {
                        menu_add_items(
                            (*pd).menu,
                            popup_internal_menu_items.as_ptr(),
                            std::ptr::null_mut::<cmdq_item>(),
                            c,
                            std::ptr::null_mut::<cmd_find_state>(),
                        );
                    } else {
                        menu_add_items(
                            (*pd).menu,
                            popup_menu_items.as_ptr(),
                            std::ptr::null_mut::<cmdq_item>(),
                            c,
                            std::ptr::null_mut::<cmd_find_state>(),
                        );
                    }
                    if (*m).x
                        >= ((*(*pd).menu).width)
                            .wrapping_add(4 as libc::c_int as libc::c_uint)
                            .wrapping_div(2 as libc::c_int as libc::c_uint)
                    {
                        x = ((*m).x).wrapping_sub(
                            ((*(*pd).menu).width)
                                .wrapping_add(4 as libc::c_int as libc::c_uint)
                                .wrapping_div(2 as libc::c_int as libc::c_uint),
                        );
                    } else {
                        x = 0 as libc::c_int as u_int;
                    }
                    (*pd).md = menu_prepare(
                        (*pd).menu,
                        0 as libc::c_int,
                        0 as libc::c_int,
                        std::ptr::null_mut::<cmdq_item>(),
                        x,
                        (*m).y,
                        c,
                        BOX_LINES_DEFAULT,
                        std::ptr::null::<libc::c_char>(),
                        std::ptr::null::<libc::c_char>(),
                        std::ptr::null::<libc::c_char>(),
                        std::ptr::null_mut::<cmd_find_state>(),
                        Some(
                            popup_menu_done
                                as unsafe extern "C" fn(
                                    *mut menu,
                                    u_int,
                                    key_code,
                                    *mut libc::c_void,
                                ) -> (),
                        ),
                        pd as *mut libc::c_void,
                    );
                    (*c).flags |= 0x2000000 as libc::c_int as libc::c_ulong;
                    current_block = 9508674642284537134;
                }
            }
        }
        match current_block {
            3275366147856559585 => {}
            _ => {
                (*pd).lx = (*m).x;
                (*pd).ly = (*m).y;
                (*pd).lb = (*m).b;
                return 0 as libc::c_int;
            }
        }
    }
    if ((*pd).flags & (0x1 as libc::c_int | 0x2 as libc::c_int) == 0 as libc::c_int
        || ((*pd).job).is_null())
        && ((*event).key == '\u{1b}' as i32 as libc::c_ulonglong
            || (*event).key
                == 'c' as i32 as libc::c_ulonglong | 0x200000000000 as libc::c_ulonglong)
    {
        return 1 as libc::c_int;
    }
    if !((*pd).job).is_null() {
        if (*event).key & 0xfffffffffff as libc::c_ulonglong
            >= KEYC_MOUSE as libc::c_int as libc::c_ulonglong
            && ((*event).key & 0xfffffffffff as libc::c_ulonglong)
                < KEYC_BSPACE as libc::c_int as libc::c_ulonglong
        {
            if (*pd).border_lines as libc::c_int == BOX_LINES_NONE as libc::c_int {
                px = ((*m).x).wrapping_sub((*pd).px);
                py = ((*m).y).wrapping_sub((*pd).py);
            } else {
                px = ((*m).x)
                    .wrapping_sub((*pd).px)
                    .wrapping_sub(1 as libc::c_int as libc::c_uint);
                py = ((*m).y)
                    .wrapping_sub((*pd).py)
                    .wrapping_sub(1 as libc::c_int as libc::c_uint);
            }
            if input_key_get_mouse(&mut (*pd).s, m, px, py, &mut buf, &mut len) == 0 {
                return 0 as libc::c_int;
            }
            bufferevent_write(job_get_event((*pd).job), buf as *const libc::c_void, len);
            return 0 as libc::c_int;
        }
        input_key(&mut (*pd).s, job_get_event((*pd).job), (*event).key);
    }
    return 0 as libc::c_int;
}
unsafe extern "C" fn popup_job_update_cb(mut job: *mut job) {
    let mut pd: *mut popup_data = job_get_data(job) as *mut popup_data;
    let mut evb: *mut evbuffer = (*job_get_event(job)).input;
    let mut c: *mut client = (*pd).c;
    let mut s: *mut screen = &mut (*pd).s;
    let mut data: *mut libc::c_void =
        evbuffer_pullup(evb, -(1 as libc::c_int) as ssize_t) as *mut libc::c_void;
    let mut size: size_t = evbuffer_get_length(evb);
    if size == 0 as libc::c_int as libc::c_ulong {
        return;
    }
    if !((*pd).md).is_null() {
        (*c).overlay_check = Some(
            menu_check_cb
                as unsafe extern "C" fn(
                    *mut client,
                    *mut libc::c_void,
                    u_int,
                    u_int,
                    u_int,
                    *mut overlay_ranges,
                ) -> (),
        );
        (*c).overlay_data = (*pd).md as *mut libc::c_void;
    } else {
        (*c).overlay_check = None;
        (*c).overlay_data = std::ptr::null_mut::<libc::c_void>();
    }
    input_parse_screen(
        (*pd).ictx,
        s,
        Some(popup_init_ctx_cb as unsafe extern "C" fn(*mut screen_write_ctx, *mut tty_ctx) -> ()),
        pd as *mut libc::c_void,
        data as *mut u_char,
        size,
    );
    (*c).overlay_check = Some(
        popup_check_cb
            as unsafe extern "C" fn(
                *mut client,
                *mut libc::c_void,
                u_int,
                u_int,
                u_int,
                *mut overlay_ranges,
            ) -> (),
    );
    (*c).overlay_data = pd as *mut libc::c_void;
    evbuffer_drain(evb, size);
}
unsafe extern "C" fn popup_job_complete_cb(mut job: *mut job) {
    let mut pd: *mut popup_data = job_get_data(job) as *mut popup_data;
    let mut status: libc::c_int = 0;
    status = job_get_status((*pd).job);
    if status & 0x7f as libc::c_int == 0 as libc::c_int {
        (*pd).status = (status & 0xff00 as libc::c_int) >> 8 as libc::c_int;
    } else if ((status & 0x7f as libc::c_int) + 1 as libc::c_int) as libc::c_schar as libc::c_int
        >> 1 as libc::c_int
        > 0 as libc::c_int
    {
        (*pd).status = status & 0x7f as libc::c_int;
    } else {
        (*pd).status = 0 as libc::c_int;
    }
    (*pd).job = std::ptr::null_mut::<job>();
    if (*pd).flags & 0x1 as libc::c_int != 0
        || (*pd).flags & 0x2 as libc::c_int != 0 && (*pd).status == 0 as libc::c_int
    {
        server_client_clear_overlay((*pd).c);
    }
}
#[no_mangle]
pub unsafe extern "C" fn popup_display(
    mut flags: libc::c_int,
    mut lines: box_lines,
    mut item: *mut cmdq_item,
    mut px: u_int,
    mut py: u_int,
    mut sx: u_int,
    mut sy: u_int,
    mut env: *mut environ,
    mut shellcmd: *const libc::c_char,
    mut argc: libc::c_int,
    mut argv: *mut *mut libc::c_char,
    mut cwd: *const libc::c_char,
    mut title: *const libc::c_char,
    mut c: *mut client,
    mut s: *mut session,
    mut style: *const libc::c_char,
    mut border_style: *const libc::c_char,
    mut cb: popup_close_cb,
    mut arg: *mut libc::c_void,
) -> libc::c_int {
    let mut pd: *mut popup_data = std::ptr::null_mut::<popup_data>();
    let mut jx: u_int = 0;
    let mut jy: u_int = 0;
    let mut o: *mut options = std::ptr::null_mut::<options>();
    let mut sytmp: style = style {
        gc: grid_cell {
            data: utf8_data {
                data: [0; 21],
                have: 0,
                size: 0,
                width: 0,
            },
            attr: 0,
            flags: 0,
            fg: 0,
            bg: 0,
            us: 0,
            link: 0,
        },
        ignore: 0,
        fill: 0,
        align: STYLE_ALIGN_DEFAULT,
        list: STYLE_LIST_OFF,
        range_type: STYLE_RANGE_NONE,
        range_argument: 0,
        range_string: [0; 16],
        width: 0,
        pad: 0,
        default_type: STYLE_DEFAULT_BASE,
    };
    if !s.is_null() {
        o = (*(*(*s).curw).window).options;
    } else {
        o = (*(*(*(*c).session).curw).window).options;
    }
    if lines as libc::c_int == BOX_LINES_DEFAULT as libc::c_int {
        lines = options_get_number(
            o,
            b"popup-border-lines\0" as *const u8 as *const libc::c_char,
        ) as box_lines;
    }
    if lines as libc::c_int == BOX_LINES_NONE as libc::c_int {
        if sx < 1 as libc::c_int as libc::c_uint || sy < 1 as libc::c_int as libc::c_uint {
            return -(1 as libc::c_int);
        }
        jx = sx;
        jy = sy;
    } else {
        if sx < 3 as libc::c_int as libc::c_uint || sy < 3 as libc::c_int as libc::c_uint {
            return -(1 as libc::c_int);
        }
        jx = sx.wrapping_sub(2 as libc::c_int as libc::c_uint);
        jy = sy.wrapping_sub(2 as libc::c_int as libc::c_uint);
    }
    if (*c).tty.sx < sx || (*c).tty.sy < sy {
        return -(1 as libc::c_int);
    }
    pd = xcalloc(
        1 as libc::c_int as size_t,
        ::core::mem::size_of::<popup_data>() as libc::c_ulong,
    ) as *mut popup_data;
    (*pd).item = item;
    (*pd).flags = flags;
    if !title.is_null() {
        (*pd).title = xstrdup(title);
    }
    (*pd).c = c;
    (*(*pd).c).references += 1;
    (*pd).cb = cb;
    (*pd).arg = arg;
    (*pd).status = 128 as libc::c_int + 1 as libc::c_int;
    (*pd).border_lines = lines;
    memcpy(
        &mut (*pd).border_cell as *mut grid_cell as *mut libc::c_void,
        &grid_default_cell as *const grid_cell as *const libc::c_void,
        ::core::mem::size_of::<grid_cell>() as libc::c_ulong,
    );
    style_apply(
        &mut (*pd).border_cell,
        o,
        b"popup-border-style\0" as *const u8 as *const libc::c_char,
        std::ptr::null_mut::<format_tree>(),
    );
    if !border_style.is_null() {
        style_set(&mut sytmp, &grid_default_cell);
        if style_parse(&mut sytmp, &mut (*pd).border_cell, border_style) == 0 as libc::c_int {
            (*pd).border_cell.fg = sytmp.gc.fg;
            (*pd).border_cell.bg = sytmp.gc.bg;
        }
    }
    (*pd).border_cell.attr = 0 as libc::c_int as u_short;
    screen_init(&mut (*pd).s, jx, jy, 0 as libc::c_int as u_int);
    colour_palette_init(&mut (*pd).palette);
    colour_palette_from_option(&mut (*pd).palette, global_w_options);
    memcpy(
        &mut (*pd).defaults as *mut grid_cell as *mut libc::c_void,
        &grid_default_cell as *const grid_cell as *const libc::c_void,
        ::core::mem::size_of::<grid_cell>() as libc::c_ulong,
    );
    style_apply(
        &mut (*pd).defaults,
        o,
        b"popup-style\0" as *const u8 as *const libc::c_char,
        std::ptr::null_mut::<format_tree>(),
    );
    if !style.is_null() {
        style_set(&mut sytmp, &grid_default_cell);
        if style_parse(&mut sytmp, &mut (*pd).defaults, style) == 0 as libc::c_int {
            (*pd).defaults.fg = sytmp.gc.fg;
            (*pd).defaults.bg = sytmp.gc.bg;
        }
    }
    (*pd).defaults.attr = 0 as libc::c_int as u_short;
    (*pd).px = px;
    (*pd).py = py;
    (*pd).sx = sx;
    (*pd).sy = sy;
    (*pd).ppx = px;
    (*pd).ppy = py;
    (*pd).psx = sx;
    (*pd).psy = sy;
    (*pd).job = job_run(
        shellcmd,
        argc,
        argv,
        env,
        s,
        cwd,
        Some(popup_job_update_cb as unsafe extern "C" fn(*mut job) -> ()),
        Some(popup_job_complete_cb as unsafe extern "C" fn(*mut job) -> ()),
        None,
        pd as *mut libc::c_void,
        0x1 as libc::c_int | 0x4 as libc::c_int | 0x2 as libc::c_int | 0x8 as libc::c_int,
        jx as libc::c_int,
        jy as libc::c_int,
    );
    (*pd).ictx = input_init(
        std::ptr::null_mut::<window_pane>(),
        job_get_event((*pd).job),
        &mut (*pd).palette,
    );
    server_client_set_overlay(
        c,
        0 as libc::c_int as u_int,
        Some(
            popup_check_cb
                as unsafe extern "C" fn(
                    *mut client,
                    *mut libc::c_void,
                    u_int,
                    u_int,
                    u_int,
                    *mut overlay_ranges,
                ) -> (),
        ),
        Some(
            popup_mode_cb
                as unsafe extern "C" fn(
                    *mut client,
                    *mut libc::c_void,
                    *mut u_int,
                    *mut u_int,
                ) -> *mut screen,
        ),
        Some(
            popup_draw_cb
                as unsafe extern "C" fn(
                    *mut client,
                    *mut libc::c_void,
                    *mut screen_redraw_ctx,
                ) -> (),
        ),
        Some(
            popup_key_cb
                as unsafe extern "C" fn(
                    *mut client,
                    *mut libc::c_void,
                    *mut key_event,
                ) -> libc::c_int,
        ),
        Some(popup_free_cb as unsafe extern "C" fn(*mut client, *mut libc::c_void) -> ()),
        Some(popup_resize_cb as unsafe extern "C" fn(*mut client, *mut libc::c_void) -> ()),
        pd as *mut libc::c_void,
    );
    return 0 as libc::c_int;
}
unsafe extern "C" fn popup_editor_free(mut pe: *mut popup_editor) {
    unlink((*pe).path);
    free((*pe).path as *mut libc::c_void);
    free(pe as *mut libc::c_void);
}
unsafe extern "C" fn popup_editor_close_cb(mut status: libc::c_int, mut arg: *mut libc::c_void) {
    let mut pe: *mut popup_editor = arg as *mut popup_editor;
    let mut f: *mut FILE = std::ptr::null_mut::<FILE>();
    let mut buf: *mut libc::c_char = std::ptr::null_mut::<libc::c_char>();
    let mut len: off_t = 0 as libc::c_int as off_t;
    if status != 0 as libc::c_int {
        ((*pe).cb).expect("non-null function pointer")(
            std::ptr::null_mut::<libc::c_char>(),
            0 as libc::c_int as size_t,
            (*pe).arg,
        );
        popup_editor_free(pe);
        return;
    }
    f = fopen((*pe).path, b"r\0" as *const u8 as *const libc::c_char);
    if !f.is_null() {
        fseeko(f, 0 as libc::c_int as __off_t, 2 as libc::c_int);
        len = ftello(f);
        fseeko(f, 0 as libc::c_int as __off_t, 0 as libc::c_int);
        if len == 0 as libc::c_int as libc::c_long
            || len as uintmax_t > 18446744073709551615 as libc::c_ulong
            || {
                buf = malloc(len as libc::c_ulong) as *mut libc::c_char;
                buf.is_null()
            }
            || fread(
                buf as *mut libc::c_void,
                len as libc::c_ulong,
                1 as libc::c_int as libc::c_ulong,
                f,
            ) != 1 as libc::c_int as libc::c_ulong
        {
            free(buf as *mut libc::c_void);
            buf = std::ptr::null_mut::<libc::c_char>();
            len = 0 as libc::c_int as off_t;
        }
        fclose(f);
    }
    ((*pe).cb).expect("non-null function pointer")(buf, len as size_t, (*pe).arg);
    popup_editor_free(pe);
}
#[no_mangle]
pub unsafe extern "C" fn popup_editor(
    mut c: *mut client,
    mut buf: *const libc::c_char,
    mut len: size_t,
    mut cb: popup_finish_edit_cb,
    mut arg: *mut libc::c_void,
) -> libc::c_int {
    let mut pe: *mut popup_editor = std::ptr::null_mut::<popup_editor>();
    let mut fd: libc::c_int = 0;
    let mut f: *mut FILE = std::ptr::null_mut::<FILE>();
    let mut cmd: *mut libc::c_char = std::ptr::null_mut::<libc::c_char>();
    let mut path: [libc::c_char; 19] =
        *::core::mem::transmute::<&[u8; 19], &mut [libc::c_char; 19]>(b"/tmp/tmux.XXXXXXXX\0");
    let mut editor: *const libc::c_char = std::ptr::null::<libc::c_char>();
    let mut px: u_int = 0;
    let mut py: u_int = 0;
    let mut sx: u_int = 0;
    let mut sy: u_int = 0;
    editor = options_get_string(
        global_options,
        b"editor\0" as *const u8 as *const libc::c_char,
    );
    if *editor as libc::c_int == '\0' as i32 {
        return -(1 as libc::c_int);
    }
    fd = mkstemp(path.as_mut_ptr());
    if fd == -(1 as libc::c_int) {
        return -(1 as libc::c_int);
    }
    f = fdopen(fd, b"w\0" as *const u8 as *const libc::c_char);
    if f.is_null() {
        return -(1 as libc::c_int);
    }
    if fwrite(
        buf as *const libc::c_void,
        len,
        1 as libc::c_int as libc::c_ulong,
        f,
    ) != 1 as libc::c_int as libc::c_ulong
    {
        fclose(f);
        return -(1 as libc::c_int);
    }
    fclose(f);
    pe = xcalloc(
        1 as libc::c_int as size_t,
        ::core::mem::size_of::<popup_editor>() as libc::c_ulong,
    ) as *mut popup_editor;
    (*pe).path = xstrdup(path.as_mut_ptr());
    (*pe).cb = cb;
    (*pe).arg = arg;
    sx = ((*c).tty.sx)
        .wrapping_mul(9 as libc::c_int as libc::c_uint)
        .wrapping_div(10 as libc::c_int as libc::c_uint);
    sy = ((*c).tty.sy)
        .wrapping_mul(9 as libc::c_int as libc::c_uint)
        .wrapping_div(10 as libc::c_int as libc::c_uint);
    px = ((*c).tty.sx)
        .wrapping_div(2 as libc::c_int as libc::c_uint)
        .wrapping_sub(sx.wrapping_div(2 as libc::c_int as libc::c_uint));
    py = ((*c).tty.sy)
        .wrapping_div(2 as libc::c_int as libc::c_uint)
        .wrapping_sub(sy.wrapping_div(2 as libc::c_int as libc::c_uint));
    xasprintf(
        &mut cmd as *mut *mut libc::c_char,
        b"%s %s\0" as *const u8 as *const libc::c_char,
        editor,
        path.as_mut_ptr(),
    );
    if popup_display(
        0x4 as libc::c_int | 0x1 as libc::c_int,
        BOX_LINES_DEFAULT,
        std::ptr::null_mut::<cmdq_item>(),
        px,
        py,
        sx,
        sy,
        std::ptr::null_mut::<environ>(),
        cmd,
        0 as libc::c_int,
        std::ptr::null_mut::<*mut libc::c_char>(),
        b"/tmp/\0" as *const u8 as *const libc::c_char,
        std::ptr::null::<libc::c_char>(),
        c,
        std::ptr::null_mut::<session>(),
        std::ptr::null::<libc::c_char>(),
        std::ptr::null::<libc::c_char>(),
        Some(popup_editor_close_cb as unsafe extern "C" fn(libc::c_int, *mut libc::c_void) -> ()),
        pe as *mut libc::c_void,
    ) != 0 as libc::c_int
    {
        popup_editor_free(pe);
        free(cmd as *mut libc::c_void);
        return -(1 as libc::c_int);
    }
    free(cmd as *mut libc::c_void);
    return 0 as libc::c_int;
}
